You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a media element is removed from a Document, the user agent must run the following steps:
...
2. ⌛ If the media element is in a document, return.
3. ⌛ Run the internal pause steps for the media element.
This makes sense, insofar as removing a media element from the Document removes the ability for the user to pause playback of that media themselves. However, recent additions to the Web Platform allow media which began playback inside a Document to continue outside that document: the Picture-in-Picture API and the Remote Playback API both provide for this ability.
When media is being presented to the user, by the user agent, pausing that presentation when the page makes a Document tree change is at best unnecessary and at worst user-hostile.
I propose replacing the condition of "removed from a Document" with a new condition, something like "visible to the user". That new condition can be exposed by HTML to other specifications, which can set or clear this condition without monkey patching.
The text was updated successfully, but these errors were encountered:
@whatwg/media We'd like to move this forward, as it's blocking the progress on the PiP spec. Should we prepare a PR based on @jernoble's recommendation? Although @marcoscaceres and I not sure that visibility is the right condition, as it also applies to Remote Playback, and there's still a way for the web app to pause playback.
Presumably the media element can still be used to control playback? E.g., setting muted and such works?
I would suggest giving media elements an associated boolean plays outside document which PiP and Remote Playback set and unset appropriately. When it is true, we don't run the internal pause steps in HTML.
We should also make sure that everyone is okay with the implications:
There's a connected media element M.
PiP starts.
M is disconnected from the document.
PiP continues.
M is connected to the same document again. (What happens if it's connected to a different document?)
PiP ends.
M is disconnected.
Is M now paused? What if M was connected to a different document in step 5?
The HTML specification states:
This makes sense, insofar as removing a media element from the Document removes the ability for the user to pause playback of that media themselves. However, recent additions to the Web Platform allow media which began playback inside a Document to continue outside that document: the Picture-in-Picture API and the Remote Playback API both provide for this ability.
When media is being presented to the user, by the user agent, pausing that presentation when the page makes a Document tree change is at best unnecessary and at worst user-hostile.
I propose replacing the condition of "removed from a Document" with a new condition, something like "visible to the user". That new condition can be exposed by HTML to other specifications, which can set or clear this condition without monkey patching.
The text was updated successfully, but these errors were encountered: