| Summary: | Plasma browser integration playlist controls aren't working on Bandcamp | ||
|---|---|---|---|
| Product: | [Plasma] plasma-browser-integration | Reporter: | Shmerl <shtetldik> |
| Component: | Firefox | Assignee: | Kai Uwe Broulik <kde> |
| Status: | RESOLVED INTENTIONAL | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Debian testing | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Shmerl
2019-12-04 03:19:23 UTC
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. |