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

Reply via email to