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 function 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 combination.
Details
Details
- Reviewers
davidedmundson fvogt - Group Reviewers
Plasma - Commits
- R856:71b4b66d5cf1: Also store the player's frame ID
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
Diff Detail
Diff Detail
- Repository
- R856 Plasma Browser Integration
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
Couldn't find anything wrong, but I'm currently missing the overview of all MPRIS stuff in here to actually review properly...