MediaSource: canConstructInDedicatedWorker static property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The canConstructInDedicatedWorker static property of the MediaSource interface returns true if MediaSource worker support is implemented, providing a low-latency feature detection mechanism.

If this were not available, the alternative would be a much higher latency approach such as attempting the creation of a MediaSource object from a dedicated worker and transferring the result back to the main thread.

Value

A boolean. Returns true if MediaSource worker support is implemented, or false otherwise.

Examples

js
if (MediaSource.canConstructInDedicatedWorker) {
  // MSE is available in workers; let's do this
}

Specifications

Specification
Media Source Extensions™
# dom-mediasource-canconstructindedicatedworker

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
canConstructInDedicatedWorker static property
Experimental

See also