W3cubDocs

/DOM

MediaStream.constructor

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.

Syntax

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

Parameters

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

Return value

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

Specifications

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

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 55 Yes 44 No 42 No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 55 55 Yes 42 ? No 6.0

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/MediaStream