- From: Jean-Yves Avenard via GitHub <sysbot+gh@w3.org>
- Date: Thu, 19 Sep 2024 08:32:09 +0000
- To: public-html-media@w3.org
jyavenard has just created a new issue for https://github.com/w3c/media-source: == Proposal: Have a detachable non-destructive MediaSource object == A MediaSource object is typically attached to a media element. When this MediaSource is detached from the media element (such as when the src or srcObject attribute is cleared or set to another object), the “[3.15.2 Detaching from a media element](https://w3c.github.io/media-source/#mediasource-detach)” algorithm is to be run which will clear all its source buffers and their content and change the readyState of the MediaSource object to “close” Discussion with users has show interests on having the ability to detach a MediaSource from a media element temporarily to re-attach it again later so that a new MediaSource doesn’t need to be created and having to reload all the original content again which is slow, impact playback quality and result in an interruption. Proposal: Provide an optional dictionary to the MediaSource constructor. it could take an optional dictionary with `{ detachable: true }` such as `const ms = new MediaSource({ detachable: true })` ``` dictionary MediaSourceInit { boolean detachable = false; }; ``` The in the MediaSource IDL, the constructor would be amended as follow: ``` constructor(); ``` to ``` constructor(optional MediaSourceInit init = { }); ``` and same for the `ManagedMediaSource`'s constructor. A new `detachable` attribute would be added, allowing to detect the functionality and test test if a `MediaSource` is detachable or not. ``` readonly attribute boolean detachable; ``` When a detachable MediaSource is detached from the mediaElement, the `Detaching from a media element` algorithm https://w3c.github.io/media-source/#mediasource-detach step 5, 8 and 9 would be skipped. in the `Attaching to a media element` algorithm (https://w3c.github.io/media-source/#mediasource-attach) steps would be modified to allow re-using a MediaSourceHandle (if in worker) or a MediaSource. Such as ignoring the "has ever been attached" internal slot Please view or discuss this issue at https://github.com/w3c/media-source/issues/357 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 19 September 2024 08:32:10 UTC