captureStream() for <audio> and <video>Limited availability
The captureStream() method for <audio> and <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: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–148Not supported
149+Supportedsince Mar 24, 2026
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–61Not supported
62+Supportedsince Oct 24, 2017
Current: 155Firefox Android
4–148Not supported
149+Supportedsince Mar 24, 2026
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How 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
}