D20726: Call into native Media Session browser API if available
Kai Uwe Broulik
noreply at phabricator.kde.org
Mon Apr 22 09:49:32 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
Since Chrome 73 it also supports Media Session also on the desktop.
The calls are re-arranged since `setActionHandler` throws if passed an invalid action and in this case we don't want to register the callback either.
Also, there's a new "skipad" action for a "Skip Ad" overlay in picture-in-picture mode [1] for which to work we need to call the native browser APIs.
Also, since `MediaMetadata` is a proper class and not an `Object`, iterate its prototype rather than just stringifying it and adjust our shim to do the same.
[1] https://www.chromestatus.com/feature/4749278882824192
TEST PLAN
Tried this example [1] in Chrome, now get a "Skip ad" button in the PIP overlay.
Firefox still works as before
[1] https://googlechrome.github.io/samples/picture-in-picture/skip-ad.html
REPOSITORY
R856 Plasma Browser Integration
REVISION DETAIL
https://phabricator.kde.org/D20726
AFFECTED FILES
extension/content-script.js
To: broulik, #plasma, fvogt
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190422/9b26ec4b/attachment-0001.html>
More information about the Plasma-devel
mailing list