MediaSource: canConstructInDedicatedWorker static property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is available in Dedicated Web Workers.

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

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
canConstructInDedicatedWorker static property
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
footnote See bug 200147
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 108 (Release date: 2022-11-29)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 18 (Release date: 2024-09-16)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
footnote See bug 200147

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support

See also