Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should PiP video removed from the DOM leave PiP? #99

Open
beaufortfrancois opened this issue Nov 7, 2018 · 13 comments
Open

Should PiP video removed from the DOM leave PiP? #99

beaufortfrancois opened this issue Nov 7, 2018 · 13 comments

Comments

@beaufortfrancois
Copy link
Collaborator

beaufortfrancois commented Nov 7, 2018

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:

  • In Chrome, it pauses the video as HTML spec says and nothing more.
  • In Safari, it pauses the video as well but also leaves Picture-in-Picture.

It looks like Safari takes a hint from the Fullscreen API:

Whenever the removing steps run with a removedNode, run these steps:

  1. Let document be removedNode’s node document.
  2. Let nodes be removedNode’s shadow-including inclusive descendants that have their fullscreen flag set, in shadow-including tree order.
  3. For each node in nodes:
    1. If node is document’s fullscreen element, exit fullscreen document.
    2. Otherwise, unfullscreen node.
    3. If document’s top layer contains node, remove node from document’s top layer.

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.

@beaufortfrancois
Copy link
Collaborator Author

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.

@mounirlamouri
Copy link
Member

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?

@jernoble
Copy link

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

@mounirlamouri
Copy link
Member

@beaufortfrancois should we close?

@beaufortfrancois
Copy link
Collaborator Author

Sure. Let's close.

@beaufortfrancois
Copy link
Collaborator Author

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?

@mounirlamouri
Copy link
Member

mounirlamouri commented Oct 12, 2020

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.

@beaufortfrancois
Copy link
Collaborator Author

beaufortfrancois commented Oct 13, 2020

@pliu6 @jernoble Do you have plans to update the HTML spec?

@beaufortfrancois
Copy link
Collaborator Author

@jernoble (gentle ping)

@beaufortfrancois
Copy link
Collaborator Author

@pliu6 (gentle ping)

@jernoble
Copy link

jernoble commented Jan 7, 2021

Raised an issue against HTML: whatwg/html#6271

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 14, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: TODO
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 14, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: TODO
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 14, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: TODO
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 14, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: TODO
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 14, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: TODO
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 18, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: 1167643
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 20, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: 1167643
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627311
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845100}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 20, 2021
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: 1167643
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627311
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845100}
@beaufortfrancois
Copy link
Collaborator Author

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 web-platform-tests/wpt#27185 and make sure both Chrome and Safari browsers pass them.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jan 22, 2021
…deo when removed from document, a=testonly

Automatic update from web-platform-tests
[Picture-in-Picture] Do not pause PiP video when removed from document

This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: 1167643
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627311
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845100}

--

wpt-commits: c021b6e74824432009f921266ecb34c4585911e2
wpt-pr: 27185
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Jan 25, 2021
…deo when removed from document, a=testonly

Automatic update from web-platform-tests
[Picture-in-Picture] Do not pause PiP video when removed from document

This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: 1167643
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627311
Commit-Queue: François Beaufort <beaufort.francoisgmail.com>
Reviewed-by: Mounir Lamouri <mlamourichromium.org>
Cr-Commit-Position: refs/heads/master{#845100}

--

wpt-commits: c021b6e74824432009f921266ecb34c4585911e2
wpt-pr: 27185

UltraBlame original commit: 932af8508133dffede9337c6c8193c0cff03eb4c
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Jan 29, 2021
…deo when removed from document, a=testonly

Automatic update from web-platform-tests
[Picture-in-Picture] Do not pause PiP video when removed from document

This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: 1167643
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627311
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845100}

--

wpt-commits: c021b6e74824432009f921266ecb34c4585911e2
wpt-pr: 27185
@mounirlamouri mounirlamouri removed the agenda Topic should be discussed in a group call label Feb 8, 2021
@mounirlamouri
Copy link
Member

Removing agenda label as it sounds that this is reaching a conclusion.

mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
This CL makes sure video do not pause when playing in Picture-in-Picture
and subsequently removed from the Document.

Spec: w3c/picture-in-picture#99

Change-Id: Ifefd961803cc47c64d394aa52454313cbcef603a
Bug: 1167643
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627311
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845100}
GitOrigin-RevId: 38117682e81b25f0307256541f6a9bb4fda887ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants