Open beaufortfrancois opened 5 years ago
It would be great if spec could document the intended behavior for this.
@jernoble @mounirlamouri Let me know what you think and I'll update the spec.
Given that you can send a video not in the document in PIP, I see no reason why leaving the document should exit Picture-in-Picture. I don't have a strong opinion because it's probably an edge case anyway. Is there a specific reason why Safari did this?
We're debating this internally. We think it was just a side effect of our original conflation of "fullscreen presentation modes" and "picture-in-picture", and not intended as an explicit policy.
WebKit has always supported entering video fullscreen from a non-DOM
@beaufortfrancois should we close?
Sure. Let's close.
It looks like Safari updated their behaviour:
When a video is playing in the picture-in-picture mode, do not pause it or exit the
picture-in-picture mode when detaching the video element from the DOM.
Source: https://trac.webkit.org/changeset/265904/webkit/
@mounirlamouri Shall we update Chrome and not pause as well for consistency?
The issue with not pausing is that it goes against the HTML specification requirements (see just above https://html.spec.whatwg.org/multipage/media.html#seeking).
That means the WebKit change is against spec. I would rather not have the Picture-in-Picture specification changes the behaviour of the HTML specification. We could obviously ask for the HTML specification to update this section if we believe it's worth it.
@pliu6 @jernoble Do you have plans to update the HTML spec?
@jernoble (gentle ping)
@pliu6 (gentle ping)
Raised an issue against HTML: https://github.com/whatwg/html/issues/6271
I've just updated Chromium to make sure video do not pause when playing in Picture-in-Picture and subsequently removed from the Document. See CL at https://chromium-review.googlesource.com/c/chromium/src/+/2627311
I've also added some web platform tests at https://github.com/web-platform-tests/wpt/pull/27185 and make sure both Chrome and Safari browsers pass them.
Removing agenda label as it sounds that this is reaching a conclusion.
In Chrome and Safari, a video element not attached to the DOM can start playing and enter Picture-in-Picture. When video is attached to the DOM while playing in Picture-in-Picture, browser implementations differ though when video is removed from the DOM:
It looks like Safari takes a hint from the Fullscreen API:
Note that the Fullscreen API doesn't allow an element not atttached to the DOM to enter fullscreen unlike Picture-in-Picture that does not prevent it.