files/en-us/web/api/mediastream/mediastream/index.md
{{APIRef("Media Capture and Streams")}}
The MediaStream() constructor returns a newly-created {{domxref("MediaStream")}}, which serves as a collection of media tracks, each represented by a {{domxref("MediaStreamTrack")}} object.
If any parameters are given, the specified tracks are added to the new stream. Otherwise, the stream has no tracks.
new MediaStream()
new MediaStream(stream)
new MediaStream(tracks)
stream {{optional_inline}}
tracks {{optional_inline}}
A newly-created {{domxref("MediaStream")}} object, either empty, or containing the tracks provided, if any.
{{Specifications}}
{{Compat}}