W3cubDocs

/Web APIs

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

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

Specifications

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 108 108 No 94 18 108 No 73
18Exposed in Mobile Safari on iPad but not on iPhone.
21.0 108
18Exposed in Mobile Safari on iPad but not on iPhone.

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/canConstructInDedicatedWorker_static