I'm using Plasma browser integration 1.7 with Firefox 72.0b1 on Debian testing (Plasma 5.14.5, which is somewhat outdated). I noticed that when opening a Youtube playlist, Plasma browser integration media controls shown in system notification area work for advancing backward and forward in the playlist. But when doing it for example on Bandcamp, that playlist functionality doesn't work. I suppose it requires some site specific logic to function?
Example to test: https://ryanike.bandcamp.com/album/west-of-loathing-original-game-soundtrack
This extension doesn't do any site-specific code. The website would need to register a callback like so: if (navigator.mediaSession) { navigator.mediaSession.setActionHandler("nexttrack", () => { // switch to next track }); }
(In reply to Kai Uwe Broulik from comment #2) > This extension doesn't do any site-specific code. The website would need to > register a callback like so: > > if (navigator.mediaSession) { > navigator.mediaSession.setActionHandler("nexttrack", () => { > // switch to next track > }); > } Is that some kind of standard? Why such specific callback and not something else? I.e. I can propose that to Bandcamp, but it must be something standardized, to make it convincing.
It is a standard :) https://developer.mozilla.org/en-US/docs/Web/API/Media_Session_API https://w3c.github.io/mediasession/
(In reply to Kai Uwe Broulik from comment #4) > It is a standard :) > > https://developer.mozilla.org/en-US/docs/Web/API/Media_Session_API > https://w3c.github.io/mediasession/ Great! I'll ping Bandcamp about implementing it.
Note that plasma-browser-integration implements the spec for Linux desktop, so a vanilla Firefox or Chrome will not work. On Android's Chrome it should work out of the box, though. Also, I believe on Windows it gives you global media shortcuts, so using this API is always appreciated and luckily becomes more common with websites as time goes on.