D21038: Also store the player's frame ID
Kai Uwe Broulik
noreply at phabricator.kde.org
Sun May 5 21:54:10 BST 2019
broulik created this revision.
broulik added reviewers: Plasma, davidedmundson, fvogt.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.
REVISION SUMMARY
The extension is also injected into iframes on a website. They share the same tab id as the rest of the website, so when having multiple videos embedded as iframes, they all get mpris signals relayed to them, causing e.g. a play command to suddenly start playing all of them.
This patch introduces a `playerId` which is basically tabId-frameId (with "0" being the main page) and uses that for identifying players.
The code is also simplified a bit by having a `sendPlayerTabMessage` which checks for a player being present (instead of having the caller do that everywhere) and then sends it to the appropriate tabId and frameId.
TEST PLAN
I started the video at the bottom of [1], hit pause in media controller, hit play in media controller.
Previously all the videos would start playing as they're separate embedded iframes and all got signalled the play request.
With this patch only the relevant video is controlled. Tested play, pause, seeking, volume change. Closing the tab unregisters the player as normal.
[1] https://www.winhistory.de/more/nt351.htm
REPOSITORY
R856 Plasma Browser Integration
REVISION DETAIL
https://phabricator.kde.org/D21038
AFFECTED FILES
extension/extension.js
To: broulik, #plasma, davidedmundson, 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/20190505/3c3569cf/attachment.html>
More information about the Plasma-devel
mailing list