This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The MediaStream() constructor returns a newly-created MediaStream, either empty or containing tracks, provided as an argument.


stream = new MediaStream();
stream = new MediaStream(stream);
stream = new MediaStream(tracks[]);


Another MediaStream containing tracks to add.
An Array of MediaStreamTracks to add.

Return value

A newly-created MediaStream object, either empty, or containing the tracks provided, if any.


Specification Status Comment
Media Capture and Streams
The definition of 'MediaStream' in that specification.
Candidate Recommendation  

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 55Edge Full support YesFirefox Full support 44IE No support NoOpera Full support 42Safari No support NoWebView Android Full support 55Chrome Android Full support 55Edge Mobile Full support YesFirefox Android Full support 42Opera Android ? Safari iOS No support NoSamsung Internet Android Full support 6.0


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: fscholz, jpmedley, david_ross, Jib
Last updated by: fscholz,