Use Windows Media Overlay rather than Scrobbling
Use the Windows Media Overlay with the Windows API rather than relying on third party squabbling
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!
whoops uhh i messed up formatting but you get the point
@PKBeam i still think u should review this man its a game changer
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 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
@PKBeam yea windows media detects pauses i think