document.pictureInPictureElement = undefined
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
People
(Reporter: kevin.godell, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:82.0) Gecko/20100101 Firefox/82.0
Steps to reproduce:
Set a video player into picture in picture mode via the context menu. Check the value of document.pictureInPictureElement. Tested on mac with firefox versions 82.0.2 (64-bit) and 83.0b9 (64-bit);
Actual results:
document.pictureInPictureElement is always undefined.
Expected results:
document.pictureInPictureElement should be null if no video element is in pip mode. It should return the video element if one is in pip mode. This works ok in chrome and edge. In safari, I use webkitPresentationMode of the video element.
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•5 years ago
|
||
I don't recall if we plan to implement the PiP API for websites to access. I think my memory says "no, there are no plans to expose PiP to the website", but...
Comment 3•5 years ago
|
||
Correct - currently, there are no plans to implement this API. See https://github.com/mozilla/standards-positions/issues/72.
So I think this is WONTFIX for now.
| Reporter | ||
Comment 4•5 years ago
|
||
Thanks for the fast response and confirmation that this property is not implemented. I thought that maybe it was moz prefixed and I was ignorant to figure it out. The real-life problem is that when implementing my video streaming solution for the node-red community (https://nodered.org/), I received a feature request to unload a video src when the video element is scrolled out of view in order to save bandwidth. When using intersection observer, the video element is being reported as out of bounds even though it has been elevated to a pip video. I will report back to the node-red users that we will be unable to support pip detection on firefox for the foreseeable future. Thanks for your time.
-kevinGodell
Comment 5•5 years ago
|
||
(In reply to kevin.godell from comment #4)
Hmm, isn't that problematic when the video has audio anyways? I hate when something I'm watching (be it in PiP or not) stops playing when I scroll just because, but maybe it's just me :)
| Reporter | ||
Comment 6•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #5)
(In reply to kevin.godell from comment #4)
Hmm, isn't that problematic when the video has audio anyways? I hate when something I'm watching (be it in PiP or not) stops playing when I scroll just because, but maybe it's just me :)
Yes, it would be problematic if it was unexpected behavior. This is a feature that a user turns on to automatically unload a video if it scrolls out of view or when changing tabs and document.visibilityState changes to hidden. I deliberately do not unload a video if it is in fullscreen or pip mode, since obviously the user has intended to keep it visible.
For this instance, I think some video will be worth a thousand comments. https://drive.google.com/drive/folders/16WOJgh8YUOsiOmfzj5TsDEfOXu5EM32-?usp=sharing
Thank you for the comments.
-kevinGodell
Description
•