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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support55 Yes44 No42 No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support5555 Yes42 ? No6.0

See also

Document Tags and Contributors

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