Get to know MDN better
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 MediaSourceHandle interface of the Media Source Extensions API is a proxy for a MediaSource that can be transferred from a dedicated worker back to the main thread and attached to a media element via its HTMLMediaElement.srcObject property. MediaSource objects are not transferable because they are event targets, hence the need for MediaSourceHandles.
It can be accessed via the MediaSource.handle property.
Each MediaSource object created inside a dedicated worker has its own distinct MediaSourceHandle. The MediaSource.handle getter will always return the MediaSourceHandle instance specific to the associated dedicated worker MediaSource instance. If the handle has already been transferred to the main thread using postMessage(), the handle instance in the worker is technically detached and can't be transferred again.
MediaSourceHandle is a transferable object.
None.
None.
The handle property can be accessed inside a dedicated worker and the resulting MediaSourceHandle object is then transferred over to the thread that created the worker (in this case the main thread) via a postMessage() call:
Over in the main thread, we receive the handle via a message event handler, attach it to a <video> via its HTMLMediaElement.srcObject property, and play the video:
Note: MediaSourceHandles cannot be successfully transferred into or via a shared worker or service worker.
| Media Source Extensions™ # mediasourcehandle |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jun 24, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.