It is currently April 20th, 2024, 12:11 pm

Media Player Plugin

Share and get help with Plugins and Addons
i2002
Posts: 24
Joined: December 6th, 2021, 10:07 am

Media Player Plugin

Post by i2002 »

This plugin enables skins to get the track info and control any media player that shows up in the volume notification in Windows 10.
Any skin that uses NowPlaying measure can be modified to work with this plugin.

volume_media.png
(volume popup in Windows)

Usage
The plugin has the same options as the NowPlaying measure (Rainmeter documentation, however only the PlayerType option and the bangs are used)
For example:

Code: Select all

[mTitle]
Measure=Plugin
PluginName=MediaPlayer.dll
PlayerType=Title
To adapt an existing skin, just replace

Code: Select all

Measure=NowPlaying
; or
Measure=Plugin
Plugin=NowPlaying
with

Code: Select all

Measure=Plugin
Plugin=MediaPlayer.dll
in the skin file.

Sample skin
skin_demo.png

Limitations
  • The OpenPlayer, ClosePlayer and TogglePlayer bangs as well as Rating and Volume player types are not supported (the Windows API doesn't provide these functions)
  • The plugin works only in Windows 10 (most likely version 1809 or newer, however I don't have older versions to test compatibility)
How to get it
You can download the plugin and the sample skin here: https://github.com/i2002/RainmeterMediaPlayer/releases.
And the source code can be seen at Github: https://github.com/i2002/RainmeterMediaPlayer
You do not have the required permissions to view the files attached to this post.
Last edited by i2002 on August 13th, 2023, 12:30 pm, edited 2 times in total.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

As you wrote, your plugin only works under Windows 10. Too bad it doesn't work under Windows 11. There, i get the error:
Screenshot 2021-12-08 083804.png
Maybe you can adapt it as soon as you switched to Windows 11 yourself?!
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Media Player Plugin

Post by jsmorley »

ikarus1969 wrote: December 8th, 2021, 7:41 am As you wrote, your plugin only works under Windows 10. Too bad it doesn't work under Windows 11. There, i get the error:
Screenshot 2021-12-08 083804.png

Maybe you can adapt it as soon as you switched to Windows 11 yourself?!
I'm on Windows 11 and don't get that.
i2002
Posts: 24
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

ikarus1969 wrote: December 8th, 2021, 7:41 am As you wrote, your plugin only works under Windows 10. Too bad it doesn't work under Windows 11. There, i get the error:
Screenshot 2021-12-08 083804.png

Maybe you can adapt it as soon as you switched to Windows 11 yourself?!
I believe it should have worked also in Win 11, as I don't think they have removed the API and there are not too many differences between 10 and 11 from the development perspective.

Maybe the C++ runtime libraries are not installed / older version. Try to install the vc++ redist from here https://aka.ms/vs/17/release/vc_redist.x64.exe
(link taken from this page: https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170).
I may have not encountered this problem because I already have the libraries for development.

Also maybe a mismatch between the 64-bit and 32-bit versions of the dll, rainmeter and OS?
The .rmskin should include the plugin dll for both 32-bit and 64-bit, but I have tested only the 64-bit version with 64-bit Rainmeter on a 64-bit machine.

Unfortunately, I don't have Win 11 yet so I can't test it there.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

I will check the c++ runtime libraries and see if that resolves my issue, thanks!
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Media Player Plugin

Post by balala »

i2002 wrote: December 6th, 2021, 12:37 pm This plugin enables skins to get the track info and control any media player that shows up in the volume notification in Windows 10.
:thumbup: :thumbup: :thumbup: :thumbup: :thumbup: :great: :great: :great: :great: :great: :thumbup: :thumbup: :thumbup: :thumbup: :thumbup:
This is an AWESOME PLUGIN. An excelent work, many - many congratulations for it. Since we have Windows 10, I always looked for a plugin which could control Groove Music, because as we know, the NowPlaying measures can't. This is the plugin I looked for. I simply love it.
One question however: if the player (as said Groove Music) is launched after the skin, the skin doesn't react until a refresh. This is an important limitation in my opinion. Is there any solution to this issue?
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

ikarus1969 wrote: December 9th, 2021, 5:57 am I will check the c++ runtime libraries and see if that resolves my issue, thanks!
I do have the latest on my system installed (beside some other/older versions):
Screenshot 2021-12-11 083109.png
So i have no idea what to check next - should i de-install the older versions?
You do not have the required permissions to view the files attached to this post.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Media Player Plugin

Post by ikarus1969 »

what i tried is to unload all other skins and reduce the MediaPlayer skin to the first measure and one single meter. After starting WindowsMediaPlayer and refreshing the skin i don't get the "error 126" but still get "no player active" on the measure/meter.
This issue is beyond my capabilities to resolve
i2002
Posts: 24
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

ikarus1969 wrote: December 11th, 2021, 7:34 am I do have the latest on my system installed (beside some other/older versions):
Screenshot 2021-12-11 083109.png

So i have no idea what to check next - should i de-install the older versions?
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.
You do not have the required permissions to view the files attached to this post.
i2002
Posts: 24
Joined: December 6th, 2021, 10:07 am

Re: Media Player Plugin

Post by i2002 »

balala wrote: December 10th, 2021, 7:50 pm :thumbup: :thumbup: :thumbup: :thumbup: :thumbup: :great: :great: :great: :great: :great: :thumbup: :thumbup: :thumbup: :thumbup: :thumbup:
This is an AWESOME PLUGIN. An excelent work, many - many congratulations for it. Since we have Windows 10, I always looked for a plugin which could control Groove Music, because as we know, the NowPlaying measures can't. This is the plugin I looked for. I simply love it.
One question however: if the player (as said Groove Music) is launched after the skin, the skin doesn't react until a refresh. This is an important limitation in my opinion. Is there any solution to this issue?
Hi,
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?
Or it has another player active (say a youtube video) and when launching Groove it doesn't switch to Groove?

If the second, the skin shows info about the active player (the one that shows up in the volume popup). If there are multiple players active, you can change the current one with the gray arrow on the right (see the first image in the first post on this thread).

If the first, it should have worked...
Are there any errors from this skin in the rainmeter log?
If you start playing a song in Groove or when the next song starts, does the skin update?
After refreshing the skin the first time, if you close Groove and open it again, does the skin update?

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.