Picture-in-Picture player window is playing fast and loose with its closing behaviour
Categories
(Toolkit :: Video/Audio Controls, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | verified |
People
(Reporter: mconley, Assigned: mconley)
References
Details
Attachments
(1 file)
The Picture-in-Picture player window is managed by PictureInPicture.jsm, and when that player window closes for various reasons, we expect to be able to do some clean-up (right now, we clear some state variables, but in the future, we also want to remove an icon from the tab where the PiP'd video was in bug 1528459).
There are a few problems, however:
- We're waiting for an "unload" event from a <xul:browser> instead of the window itself. This should be:
window.addEventListener("unload", () => {
PictureInPicture.unload();
});
- There are situations where we'll manipulate the variables that PictureInPicture.unload relies upon / clears before the unload event even fires.
Specifically, we overwrite this.browser
, and then call closePipWindow
, which will clear that new value (expecting to clear the original value) when the unload event fires if a previous window existed.
I recommend making closePipWindow
an async function that waits until the window has unloaded before continuing.
Assignee | ||
Comment 1•6 years ago
|
||
Comment 3•6 years ago
|
||
bugherder |
Updated•6 years ago
|
![]() |
||
Comment 4•6 years ago
|
||
Build ID 20190626093633
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Verified as fixed on the latest Nightly build on Windows 10.
Description
•