coderef

captureStream() for <audio> and <video>Limited availability

The captureStream() method for &#x3C;audio> and &#x3C;video> elements returns a MediaStream for the media element's content. You can use this to record media or send it elsewhere, such as a canvas or WebRTC connection.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–61Not supported
62+Supportedsince Oct 17, 2017
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–148Not supported
149+Supportedsince Mar 24, 2026
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–61Not supported
62+Supportedsince Oct 24, 2017
Current: 155
Firefox Android
4–148Not supported
149+Supportedsince Mar 24, 2026
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Safari, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: captureStream.

Feature detection

JS · check before using
if ("HTMLMediaElement" in globalThis && "captureStream" in HTMLMediaElement.prototype) {
  // HTMLMediaElement.captureStream is available
}