w3c / media-source

Media Source Extensions
https://w3c.github.io/media-source/
Other
267 stars 59 forks source link

MSE-in-Workers: Centrally define the window/worker HTMLMediaElement<->MSE API communication mechanism #279

Closed wolenetz closed 2 years ago

wolenetz commented 3 years ago

MSE-in-Workers feature issue is #175.

This issue tracks clarifying and centrally defining the communication mechanism(s) necessary for interoperable implementations MSE-in-Workers.

The initial draft spec (https://github.com/wolenetz/media-source/tree/mse-in-workers-initial-spec) has repeated large blocks of text, rather than concise reusable references, to describe the communication mechanisms in a black-box fashion. Clarity would be greatly improved, I think, if the mechanism and constraints were described in a separate section in detail in the spec.

Example of an instance that would be improved:

Set recent duration and recent live seekable range respectively to be what the duration and live seekable range were recently, with no greater delay than what would be perceived by a message listener in Window if the most recent update to duration or live seekable range had been sent from the DedicatedWorkerGlobalScope to the Window using postMessage(message, options). Note: This allowance for delay acknowledges that the HTMLMediaElement may not have direct access to the current values of duration and live seekable range when the MediaSource is in a different execution environment. Instead of forcing all implementations to block multiple execution environments until the HTMLMediaElement can reliably retrieve the precise current values of duration and live seekable range, this allowance lets both proceed under assumptions of message passing coherency that are no worse than what is allowed to the application code running in these different execution environments.

Potential improvement:

Various other places would need similar, including some that communicate from window HTMLMediaElement to worker MSE.

Currently, the following are known places in the feature draft spec that could use this improvement:

wolenetz commented 3 years ago

Steps in the [=attaching to a media element=] will need similar clarification.