It is currently May 9th, 2024, 1:31 am

Media Player Plugin

Share and get help with Plugins and Addons
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Media Player Plugin

Post by Yincognito »

sl23 wrote: August 12th, 2023, 8:31 pm Does that mean we're never going to be able to get that info for 64bit players? How does NowPlaying get the info? Is it through the CAD plugin for foobar I suppose?
It has nothing to do with the plugin architecture. According to the plugin developers (from both MediaPlayer and WebNowPlaying), the player must provide that info to the API which is then used by those plugins to show the corresponding data in Rainmeter. Thing is, not all players do this, hence the missing info. See here and here for details.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Media Player Plugin

Post by sl23 »

Got it! Thanks. I'll get onto the foobar forum and see if I can get anything from there. Maybe a feature request may be in order, hopefully it'll get implemented! No harm asking eh? :D
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Media Player Plugin

Post by Yincognito »

sl23 wrote: August 12th, 2023, 8:43 pmNo harm asking eh? :D
Surely not. In fact, if one doesn't ask, most often he doesn't get. :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Media Player Plugin

Post by balala »

Yincognito wrote: August 12th, 2023, 8:14 pm Ah, I see what you mean now. That's just the file version info of the file (basically, a string from the .dll), the .dll contents is different, and as sl23 noticed, with the said bug being fixed. Of course, the file version info should be indeed corrected to 1.2 in order to not have to force Rainmeter to copy it over the older versions and have everything going smooth. Most likely, a minor omission from the plugin developer (not accounting for the errors / warnings sl23 got, obviously).
Same here now: I see what you mean. And you're right. However it's bad the version number has not been actualized, but the new version is indeed a new one. But the proper version number would be important to be updated properly even to can get a backup of the both versions of the plugin in the @Valut folder when installing the skin. Just for safeness.
The "bug" (not sure this is the right term) has been indeed fixed. No crashing Rainmeter if I put a not-proper PlayerType.
But:
  • sl23 wrote: August 12th, 2023, 8:27 pm Well, here's my little Taskbar player showing that Progress isn't working. The track info is available as a tooltip so it doesn't show that here.
    Right, it doesn't, at least not with online playing. Does with the Media Player app of Windows 10, but even there are some issues. Progress and Position are updated once per few seconds. Don't even say: the Update of the skin is set to Update=1000 and there is no UpdateDivider option on any of the existing measures nor on meters. Double checked. Also would be nice to can get it working with online playing as well.
  • sl23 wrote: August 12th, 2023, 8:16 pm So it seems this plugin is case sensitive unlike Rainmeter.
    The PlayerType option seems indeed to be case sensitive. Not a too hugy problem from my point of view, but still...
i2002
Posts: 24
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

balala wrote: August 12th, 2023, 9:22 pm However it's bad the version number has not been actualized, but the new version is indeed a new one. But the proper version number would be important to be updated properly even to can get a backup of the both versions of the plugin in the @Valut folder when installing the skin. Just for safeness.
I agree, my bad. Forgot all the steps needed for a new release. Should be fixed now.
balala wrote: August 12th, 2023, 9:22 pm Does with the Media Player app of Windows 10, but even there are some issues. Progress and Position are updated once per few seconds. Don't even say: the Update of the skin is set to Update=1000 and there is no UpdateDivider option on any of the existing measures nor on meters. Double checked. Also would be nice to can get it working with online playing as well.
Yeah, the Update and UpdateDivider have nothing to do with that. The skin is refreshed once per second as intended, however the media players do not always update the timeline status that often, so the plugin sometimes provides older information. This whole API thing is a bit annoying because most media players are not completely integrated with it and sometimes there is some strange behavior that is hard to test.

I made a change in v1.3 that should make time updating smother (by automatically incrementing the position until the next update from the API). It sometimes still skips a second, but it seems smoother than before. Please tell me if it makes the experience better.

There is one more thing I can try that would update the time every second with no jump, the progress could be updated completely in the plugin (so that time is synced with the information from api just when the playback state or the active player changes). However there is a risk that what the plugin shows becomes out of sync with the state of the media player. I have to think about the edge cases for detecting state change to reset the position and also what to do in cases like having the playback speed at 2x (I don't believe the API tells me that information).

Online playing (as in the media that is being played from a browser tab) should work (including progress info) in Chrome and Edge (but apparently no progress info in Firefox). It also seems to depend on the site used. For example in Chrome Disney+ does not provide timeline info, but Netflix does.
On that note of compatibility, I found this table from another project that seems to be using the windows API for media player information: https://github.com/ModernFlyouts-Community/ModernFlyouts/blob/main/docs/GSMTC-Support-And-Popular-Apps.md
balala wrote: August 12th, 2023, 9:22 pm The PlayerType option seems indeed to be case sensitive. Not a too hugy problem from my point of view, but still...
I agree. At the time it didn't occur to me I should treat this scenario :)). This is now fixed.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Media Player Plugin

Post by Yincognito »

i2002 wrote: August 13th, 2023, 1:46 amOn that note of compatibility, I found this table from another project that seems to be using the windows API for media player information: https://github.com/ModernFlyouts-Community/ModernFlyouts/blob/main/docs/GSMTC-Support-And-Popular-Apps.md
Excellent find! Maybe it should be linked to or posted as a couple of screenshots on both your plugin and the WebNowPlaying one. Sure, the info there is not that pleasant to see, since there isn't a single player that has full compatibility with the System Media Transport Controls (SMTC) API, not even Microsoft ones, LOL, despite its otherwise generalist approach, but it would still be relevant and helpful for the user...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Media Player Plugin

Post by balala »

i2002 wrote: August 13th, 2023, 1:46 am I agree, my bad. Forgot all the steps needed for a new release. Should be fixed now.
Ok, thanks a lot. As said, the version fixing is needed to have a "backup" of both versions (x86 and x64) of the plugin, into the @Vault folder, when installing the skin. If the version info is not correct, this is not going on properly. So thank you for this important fix.
i2002 wrote: August 13th, 2023, 1:46 am The skin is refreshed once per second as intended,
I think you meant updated, not refreshed, right?
i2002 wrote: August 13th, 2023, 1:46 am Yeah, the Update and UpdateDivider have nothing to do with that. The skin is refreshed once per second as intended, however the media players do not always update the timeline status that often, so the plugin sometimes provides older information. This whole API thing is a bit annoying because most media players are not completely integrated with it and sometimes there is some strange behavior that is hard to test.

I made a change in v1.3 that should make time updating smother (by automatically incrementing the position until the next update from the API). It sometimes still skips a second, but it seems smoother than before. Please tell me if it makes the experience better.

There is one more thing I can try that would update the time every second with no jump, the progress could be updated completely in the plugin (so that time is synced with the information from api just when the playback state or the active player changes). However there is a risk that what the plugin shows becomes out of sync with the state of the media player. I have to think about the edge cases for detecting state change to reset the position and also what to do in cases like having the playback speed at 2x (I don't believe the API tells me that information).

Online playing (as in the media that is being played from a browser tab) should work (including progress info) in Chrome and Edge (but apparently no progress info in Firefox). It also seems to depend on the site used. For example in Chrome Disney+ does not provide timeline info, but Netflix does.
On that note of compatibility, I found this table from another project that seems to be using the windows API for media player information: https://github.com/ModernFlyouts-Community/ModernFlyouts/blob/main/docs/GSMTC-Support-And-Popular-Apps.md
Definitely can't say too much about this, my programming skills are close to 0, but what did you describe make sense. Didn't try so far the plugin and right now I can't, however sooner or later, I'll try it and will come back with comments.
i2002 wrote: August 13th, 2023, 1:46 am I agree. At the time it didn't occur to me I should treat this scenario :)). This is now fixed.
Alright, once again, thank you for all your hard work. This plugin definitely implements a great and good idea, since the NowPlaying measure doesn't work neither with online playing, nor with "modern" apps, like Media Player of Win 10 (and probably Win 11 as well). So, is good to have such a tool, to can use the same skins we did use with NowPlaying measure supported players.

As said as soon as I can give it a try, will be back with everything I'll see related to this new plugin.
i2002
Posts: 24
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

balala wrote: August 13th, 2023, 8:55 am I think you meant updated, not refreshed, right?
Yes, mixed them up.
i2002
Posts: 24
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

Yincognito wrote: August 13th, 2023, 2:45 am Excellent find! Maybe it should be linked to or posted as a couple of screenshots on both your plugin and the WebNowPlaying one. Sure, the info there is not that pleasant to see, since there isn't a single player that has full compatibility with the System Media Transport Controls (SMTC) API, not even Microsoft ones, LOL, despite its otherwise generalist approach, but it would still be relevant and helpful for the user...
Yeah :))
I think because the largest use of the api is the information thing that shows up when you change the volume (which only includes the title, artist and playback state), there isn't much incentive for application developers to implement the other functionalities.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Media Player Plugin

Post by Yincognito »

i2002 wrote: August 13th, 2023, 12:27 pm Yeah :))
I think because the largest use of the api is the information thing that shows up when you change the volume (which only includes the title, artist and playback state), there isn't much incentive for application developers to implement the other functionalities.
Good point, didn't thought about that, but it makes perfect sense. Well, the solution is simple: make skins the same. Who dares to complain, tell him that Microsoft does the same (and they're paid for it)... :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth