It is currently December 2nd, 2022, 10:19 pm

Media Player Plugin

Share and get help with Plugins and Addons
User avatar
ikarus1969
Posts: 526
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

i2002 wrote: December 11th, 2021, 5:11 pm Hi,
I've installed a Win 11 VM to test this and for me it works..

In that screenshot it appears that only the x86 libraries are installed.
On my vm fresh install I have both x86 and x64 versions:
2021-12-11 (1).png
And if I remove the x64 version I get the 126 error code as you described.

However, I don't understand why it "works" with only one measure, it should give the same error whether there is one measure or 10.
Thank you for taking all the effort with the VM and testing - i installed the x64 version too - but that doesn't help me either. But don't waste too much time on it; as others doesn't have any difficulties with it your plugin just works.
i2002
Posts: 11
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

ikarus1969 wrote: December 12th, 2021, 9:24 am Thank you for taking all the effort with the VM and testing - i installed the x64 version too - but that doesn't help me either. But don't waste too much time on it; as others doesn't have any difficulties with it your plugin just works.
I'm sorry I couldn't help you to make it work.
I really would have expected windows development to be compatible out of the box across different systems. After all, the plugin uses only Windows APIs that should ship with the system..

The last thing we can try is to install the plugin with the c++ runtime libraries statically linked (the rmskin package attached below).
Maybe this way it works.
You do not have the required permissions to view the files attached to this post.
User avatar
ikarus1969
Posts: 526
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

Thank you for this special version but it did not help. It's some setting on my system that hinders your plugin to function as it should. Maybe i should learn how to use ProcessMonitor (one of the former SysInternals tools) to possibly find out what's going on.
In the meantime please go on developing this plugin and integrate whatever suggestions may come as long as you think are useful!
Screenshot 2021-12-12 140924.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 14756
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Media Player Plugin

Post by balala »

First sorry for the extremely late reply.
i2002 wrote: December 11th, 2021, 5:28 pm What do you mean when you say it doesn't react when player is launched?
Is it initially in "No player active" state then you launch Groove and it doesn't show the song playing in Groove?
Exactly. And the same goes on with YouTube as well. The skin does work if I refresh the skin after launching either Groove Music, or YouTube, but not without a refresh.
i2002 wrote: December 11th, 2021, 5:28 pm Are there any errors from this skin in the rainmeter log?
If it does work there are no errors.
If Groove Music is playing and the skin shows what it has to, then suddenly I'm closing Groove, I get the following error message: [MediaPlayer.dll] Get media properties failed: The RPC server is unavailable. (MediaPlayer\MediaPlayer.ini - [mCover]).
Don't get the same message if YouTube is playing and I close the browser/tab.
i2002 wrote: December 11th, 2021, 5:28 pm If you start playing a song in Groove or when the next song starts, does the skin update?
No, it doesn't.
i2002 wrote: December 11th, 2021, 5:28 pm After refreshing the skin the first time, if you close Groove and open it again, does the skin update?
No, doesn't.
i2002 wrote: December 11th, 2021, 5:28 pm There might also be a thing I forgot to set before releasing the skin. If you right click the skin and click edit, in the [Rainmeter] section
you can replace this

Code: Select all

;Update=
DefaultUpdateDivider=
with

Code: Select all

Update=1000
DefaultUpdateDivider=1
and then refresh the skin.

For me it also works without those options set, but maybe it doesn't work in all cases.
No, nothing is changing when I add the DefaultUpdateDivider value.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4883
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Media Player Plugin

Post by eclectic-tech »

ikarus1969 wrote: December 12th, 2021, 1:16 pm Thank you for this special version but it did not help. It's some setting on my system that hinders your plugin to function as it should. Maybe i should learn how to use ProcessMonitor (one of the former SysInternals tools) to possibly find out what's going on.
In the meantime please go on developing this plugin and integrate whatever suggestions may come as long as you think are useful!
Not to take away from this plugin which I think can be useful, be aware you can activate Windows media window using the built-in MediaKey measure.
This example uses MouseOverAction with MediaKey's volume change commands to activate Window's media display.
It is possible to add a progress bar and position it near the default Windows media display.
This code will work with NowPlaying or WebNowPlaying by changing the MusicSwitch variable between zero (NowPlaying) and one (WebNowPlaying) respectively.
To use 'Previous' and 'Next' with WebNowPlaying you need to create a Playlist on YouTube.

Try this code to see if it works for you.

Code: Select all

; ========= Metadata ==========
[Metadata]
Name=MediaKey Play
Author=Eclectic Tech
Information=
; BY=attribution / SA=share-alike / ND=no-derivatives / NC=non-commercial
License=CC BY-SA-NC 3.0
Version=0.1

; ========= Variables ==========
[Variables]
; Zero for NowPlaying ... 1 for WebNowPlaying
MusicSwitch=1

; NowPlaying media player
PlayerInterface=CAD

; ========= Skin Settings ==========
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

MouseOverAction=[!CommandMeasure "MeasureMediaKey" "VolumeDown"][!CommandMeasure "MeasureMediaKey" "VolumeUp"]
; Using both commands activates Windows media display and changes the volume down then back again (no change).

; ========= Measures ==========
[MeasureMediaKey]
Measure=MediaKey

[mTitle0]
Measure=NowPlaying
PlayerName=#PlayerInterface#
PlayerType=TITLE
Substitute="":"NowPlaying Nothing"

[mTitle1]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Title
Substitute="":"WebNowPlaying Nothing"

[mProgress0]
Measure=NowPlaying
PlayerName=[mTitle0]
PlayerType=PROGRESS
RegExpSubstitute=1
Substitute="^0$":"Streaming"
Disabled=(#MusicSwitch#<>0?)
DynamicVariables=1

[mProgress1]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Progress
Disabled=(#MusicSwitch#<>1?)
DynamicVariables=1

; ========= Meters ==========
[MeterString]
Meter=String
MeasureName=mTitle#MusicSwitch#
H=14
Text=Media: %1
FontColor=240,240,240
SolidColor=47,47,47,100
Padding=4,4,4,4
ClipString=2
ClipStringW=493

[ProgressBar]
Group=AutoHide
Meter=Bar
MeterStyle=sText
MeasureName=mProgress#MusicSwitch#
X=r
Y=1R
W=500
H=2
BarOrientation=Horizontal
BarColor=245,245,245
SolidColor=47,47,47,220
LeftMouseUpAction=[!CommandMeasure "mTitle#MusicSwitch#" "SetPosition $MouseX:%$"]
MouseScrollUpAction=[!CommandMeasure "mTitle#MusicSwitch#" "SetPosition +5"]
MouseScrollDownAction=[!CommandMeasure "mTitle#MusicSwitch#" "SetPosition -5"]
DynamicVariables=1
TooltipType=1
ToolTipText=Progress [&mProgress#MusicSwitch#:0]%
; Documentation: https://docs.rainmeter.net/manual-beta/meters/bar/

mediakeyplay.gif
You do not have the required permissions to view the files attached to this post.
User avatar
ikarus1969
Posts: 526
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

eclectic-tech wrote: December 13th, 2021, 3:58 am Not to take away from this plugin which I think can be useful, be aware you can activate Windows media window using the built-in MediaKey measure.
Ah, one difference to your test-skin: i just can see the volume bar, not the area on the right with the controls (the Windows media display).
Maybe i can activate it by some setting in windows? Hmm, i will google a little bit.
i2002
Posts: 11
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

ikarus1969 wrote: December 13th, 2021, 5:29 am Ah, one difference to your test-skin: i just can see the volume bar, not the area on the right with the controls (the Windows media display).
Maybe i can activate it by some setting in windows? Hmm, i will google a little bit.
In windows 11 I think these are located there
tmp_screenshot.png
However I believe Windows Media Player (shown in one of your posts above) doesn't show up there. Maybe they didn't bother to update the app to support this.
If you open another player, or even a youtube video in the browser and you can see if info about that player shows up there.
Also, maybe this is the reason my plugin didn't work for you?

If you want to use WMP, AFAIK the official NowPlaying measure from Rainmeter should be compatible with Windows Media Player, so any skin that uses it should work.
You do not have the required permissions to view the files attached to this post.
i2002
Posts: 11
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

balala wrote: December 12th, 2021, 6:53 pm If Groove Music is playing and the skin shows what it has to, then suddenly I'm closing Groove, I get the following error message: [MediaPlayer.dll] Get media properties failed: The RPC server is unavailable. (MediaPlayer\MediaPlayer.ini - [mCover]).
Don't get the same message if YouTube is playing and I close the browser/tab.
That's a known thing, and it's not really an error. It's just that if the skin tries to update info just as the media player is closing, sometimes it can't, so I log this. However it keeps updating and on the next update it sees there is no player active and updates the information.

So you have checked there aren't multiple players active? I've seen that sometimes Groove duplicates itself.
However Youtube playing in a browser should not have that problem (btw, what browser are you using? I've only tested with Firefox, Chrome and Edge)

Also, does the info here change without refreshing the skin?
tmp_screenshot2.png
It seems that either the plugin works but something from Rainmeter prevents updating the skin or there is some strange condition when the player starts that hangs the plugin. I'm not quite sure how to debug these things as I cannot replicate the issue.
You do not have the required permissions to view the files attached to this post.
User avatar
ikarus1969
Posts: 526
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

i2002 wrote: December 13th, 2021, 6:12 am In windows 11 I think these are located there

tmp_screenshot.png

However I believe Windows Media Player (shown in one of your posts above) doesn't show up there. Maybe they didn't bother to update the app to support this.
If you open another player, or even a youtube video in the browser and you can see if info about that player shows up there.
Also, maybe this is the reason my plugin didn't work for you?

If you want to use WMP, AFAIK the official NowPlaying measure from Rainmeter should be compatible with Windows Media Player, so any skin that uses it should work.
I tried Youtube and it works! So it depends on the program if it supports that Windows-api. Chrome does it obviously. WMP and VLC not (yet?). So if i want to use your plugin, i had to find a compatible player. I'm happy i got it working in some sense now - thank you all for your hints and help!
User avatar
balala
Rainmeter Sage
Posts: 14756
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Media Player Plugin

Post by balala »

i2002 wrote: December 13th, 2021, 7:50 am So you have checked there aren't multiple players active? I've seen that sometimes Groove duplicates itself.
Yep, there indeed have been more instances. But closing them didn't fix the issue. The skin still refuses to show the information if it's not refreshed after start playing.
i2002 wrote: December 13th, 2021, 7:50 am However Youtube playing in a browser should not have that problem (btw, what browser are you using? I've only tested with Firefox, Chrome and Edge)
But unfortunately it has. I'm using Edge.
i2002 wrote: December 13th, 2021, 7:50 am Also, does the info here change without refreshing the skin?

tmp_screenshot2.png
No, it doesn't change.
Screenshot when the player is loaded and the skin is not refreshed:
1.png
Screenshot after a refresh:
2.png
i2002 wrote: December 13th, 2021, 7:50 am It seems that either the plugin works but something from Rainmeter prevents updating the skin or there is some strange condition when the player starts that hangs the plugin. I'm not quite sure how to debug these things as I cannot replicate the issue.
This is what I do:
  • Activate the skin (Skins\MediaPlayer\MediaPlayer.ini). Both Groove Music and YouTube are closed.
  • Launching any of the above two players (Groove or YouTube in Edge).
  • The skin doesn't show the proper information. In order to get this, I have to refresh the skin.
You do not have the required permissions to view the files attached to this post.