Active Picture-in-Picture video throttles the origin tab
Categories
(Toolkit :: Picture-in-Picture, defect, P3)
Tracking
()
People
(Reporter: rjs+dev, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
- In HTML I use the following video tag: <video autoplay muted></video>
- I draw into a canvas which is streamed to this video tag with "video.srcObject = canvas.captureStream()"
- the canvas is drawn with data provided through a websocket and by using the "setInterval()" function (which is throttled when tab becomes inactive)
- I opened the PIP mode by right clicking on the video tag and change to another tab while watching to the floating window
Actual results:
The canvas video in the floating window stucks and gets only updated when change back to the original tab or sometimes its enough to move the mouse over the original tab to trigger the tab.
Expected results:
The video should be displayed without stucking like in Google Chrome or Microsoft Edge because the tab should not be interpreted as inactive when a floating window / PIP is displayed.
Maybe there is some kind of API to prevent this for my site if the responsible developers dont see this as a bug.
I dont want to change any user browser settings to get the behavior I want.
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Toolkit::Video/Audio Controls' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Thanks for reporting this, and for the detailed explanation! I'm going to go ahead and confirm the bug without trying to reproduce it, because I feel pretty confident this is a valid bug.
It does seem like there should be something that we could be doing from within PIP itself to keep that tab running, but I wouldn't know what it is; Mike, am I on the right track there?
Comment 3•4 years ago
|
||
Yes, you're on the right track. This is familiar. The PiP feature does prevent video decoders from shutting down when associated tabs are in the background, but we don't do anything to prevent Gecko from throttling back the refresh driver on those backgrounded pages (nor from those pages from degrading their own quality when in the background - see bug 1598654).
I think ultimately, this might be a dupe of bug 1598654, to be honest - it's the same idea: the backgrounded tab is being treated as if none of it is visible, even though a portion is.
Description
•