Open Bug 1594505 Opened 5 years ago Updated 2 years ago

Make sure PictureInPicture object is the only object that interacts with the player window directly

Categories

(Toolkit :: Picture-in-Picture, task, P3)

task

Tracking

()

People

(Reporter: mconley, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [pip-needs-eng-triage])

Inside of PictureInPicture.jsm, we a class PictureInPictureParent that directly accesses the player window via the PictureInPicture global here:

https://searchfox.org/mozilla-central/rev/d061ba55ac76f41129618d638f4ef674303ec103/toolkit/components/pictureinpicture/PictureInPicture.jsm#91-93

and

https://searchfox.org/mozilla-central/rev/d061ba55ac76f41129618d638f4ef674303ec103/toolkit/components/pictureinpicture/PictureInPicture.jsm#100-102

and

https://searchfox.org/mozilla-central/rev/d061ba55ac76f41129618d638f4ef674303ec103/toolkit/components/pictureinpicture/PictureInPicture.jsm#109-111

To keep a clear separation of concerns and responsibility, I suspect it's better architecture to expose some methods on PictureInPicture to do things like setting the muted or playing state on the player window, and have PictureInPicture be responsible for actually calling into the window to set the state.

Originally suggested by mstriemer here: https://phabricator.services.mozilla.com/D51939#1581042

Component: Video/Audio Controls → Picture-in-Picture
Version: unspecified → Trunk
Whiteboard: [pip-needs-eng-triage]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.