D23090: Handle media session callbacks even when the requested one isn't supported by the browser

Kai Uwe Broulik noreply at phabricator.kde.org
Sun Aug 11 13:41:31 BST 2019


broulik created this revision.
broulik added reviewers: Plasma, fvogt.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.

REVISION SUMMARY
  The Media Session API standard evolves quite fast, so there's new actions that we might be able to support that the browser itself doesn't know yet, for instance the "stop" action.
  By checking the values ourselves and catching an exception by the browser, we're still able to handle them in the extension.

TEST PLAN
  The following now works:
  
    navigator.mediaSession.setActionHandler("stop", () => {
        console.log("stop player");
    });
  
  Clicked Stop in context menu of media controller applet, got the callback executed.
  Previously an exception would be thrown when calling `setActionHandler`

REPOSITORY
  R856 Plasma Browser Integration

REVISION DETAIL
  https://phabricator.kde.org/D23090

AFFECTED FILES
  extension/content-script.js

To: broulik, #plasma, fvogt
Cc: plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190811/b49a310f/attachment.html>


More information about the Plasma-devel mailing list