AMWin-RP icon indicating copy to clipboard operation
AMWin-RP copied to clipboard

Use Windows Media Overlay rather than Scrobbling

Open gooblet234 opened this issue 4 months ago • 5 comments

Use the Windows Media Overlay with the Windows API rather than relying on third party squabbling

Image

Example in C# UWP:

var smtc = SystemMediaTransportControls.GetForCurrentView();
smtc.DisplayUpdater.Type = MediaPlaybackType.Music;

var properties = smtc.DisplayUpdater.MusicProperties;
string title = properties.Title;
string artist = properties.Artist;
string album = properties.AlbumTitle;

var albumArtStream = await smtc.DisplayUpdater.Thumbnail.OpenReadAsync();

On Windows 10/11, there’s a SystemMediaTransportControls API. It exposes:

PlaybackStatus (Playing, Paused, Stopped) DisplayUpdater → MusicProperties (Title, Artist, AlbumArtist, AlbumTitle) Thumbnail and this would greatly cut down the code!

gooblet234 avatar Sep 08 '25 01:09 gooblet234

whoops uhh i messed up formatting but you get the point

gooblet234 avatar Sep 08 '25 01:09 gooblet234

@PKBeam i still think u should review this man its a game changer

gooblet234 avatar Oct 21 '25 01:10 gooblet234

I agree this would be the ideal implementation but it seems to be missing some features we need.

e.g. how do we obtain song progress? how do we tell if the track is paused?

PKBeam avatar Oct 26 '25 12:10 PKBeam

I agree this would be the ideal implementation but it seems to be missing some features we need.

e.g. how do we obtain song progress? how do we tell if the track is paused?

i'm not exactly sure abt the progress but i am definitely sure that there is some way to get if it's paused as osu lazer detects media playing and stops in game music, the progress could probably be pulled from AM itself. you could spoof the idea of progress by using the download function and reviewing the downloaded am songs and checking the length of the drm protected files because i dont think metadata is locked, and you could compare that length with the amount of time the song has been selected, or if apple music permits, you could pull ALL of the metadata from the drm music, but you'd need to prolly include ffmpeg which is ~100mb

gooblet234 avatar Oct 27 '25 03:10 gooblet234

@PKBeam yea windows media detects pauses i think

gooblet234 avatar Nov 04 '25 01:11 gooblet234