D21038: Also store the player's frame ID
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit R856:71b4b66d5cf1: Also store the players frame ID (authored by broulik). REPOSITORY R856 Plasma Browser Integration CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D21038?vs=57633=59048 REVISION DETAIL https://phabricator.kde.org/D21038 AFFECTED FILES extension/extension.js To: broulik, #plasma, davidedmundson, fvogt Cc: plasma-devel, ericadams, jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D21038: Also store the player's frame ID
fvogt added a comment. Couldn't find anything wrong, but I'm currently missing the overview of all MPRIS stuff in here to actually review properly... REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D21038 To: broulik, #plasma, davidedmundson, fvogt Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D21038: Also store the player's frame ID
broulik added a comment. Ping REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D21038 To: broulik, #plasma, davidedmundson, fvogt Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D21038: Also store the player's frame ID
broulik updated this revision to Diff 57633. broulik added a comment. - Don't mutate while iterating REPOSITORY R856 Plasma Browser Integration CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D21038?vs=57613=57633 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
D21038: Also store the player's frame ID
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