<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, davidedmundson, fvogt.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D21038">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>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.<br />
This patch introduces a <tt style="background: #ebebeb; font-size: 13px;">playerId</tt> which is basically tabId-frameId (with "0" being the main page) and uses that for identifying players.<br />
The code is also simplified a bit by having a <tt style="background: #ebebeb; font-size: 13px;">sendPlayerTabMessage</tt> 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.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>I started the video at the bottom of [1], hit pause in media controller, hit play in media controller.<br />
Previously all the videos would start playing as they're separate embedded iframes and all got signalled the play request.<br />
With this patch only the relevant video is controlled. Tested play, pause, seeking, volume change. Closing the tab unregisters the player as normal.<br />
[1] <a href="https://www.winhistory.de/more/nt351.htm" class="remarkup-link" target="_blank" rel="noreferrer">https://www.winhistory.de/more/nt351.htm</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R856 Plasma Browser Integration</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21038">https://phabricator.kde.org/D21038</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>extension/extension.js</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, davidedmundson, fvogt<br /><strong>Cc: </strong>plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>