files/en-us/web/api/mediastream/index.md
{{APIRef("Media Capture and Streams")}}
The MediaStream interface of the {{domxref("Media Capture and Streams API", "", "", "nocode")}} represents a stream of media content. A stream consists of several tracks, such as video or audio tracks. Each track is specified as an instance of {{domxref("MediaStreamTrack")}}.
You can obtain a MediaStream object either by using the constructor or by calling functions such as {{domxref("MediaDevices.getUserMedia()")}}, {{domxref("MediaDevices.getDisplayMedia()")}}, or {{domxref("HTMLCanvasElement.captureStream()")}} and {{domxref("HTMLMediaElement.captureStream()")}}.
{{InheritanceDiagram}}
MediaStream object. You can create an empty stream, a stream which is based upon an existing stream, or a stream that contains a specified list of tracks (specified as an array of {{domxref("MediaStreamTrack")}} objects).This interface inherits properties from its parent, {{domxref("EventTarget")}}.
true if the MediaStream is active, or false otherwise.This interface inherits methods from its parent, {{domxref("EventTarget")}}.
MediaStream object, nothing happens.MediaStream object. The clone will, however, have a unique value for {{domxref("MediaStream.id", "id")}}.MediaStream object that have their kind attribute set to audio. The order is not defined, and may not only vary from one browser to another, but also from one call to another.trackId. If no parameter is given, or if no track with that ID does exist, it returns null. If several tracks have the same ID, it returns the first one.MediaStream object, regardless of the value of the kind attribute. The order is not defined, and may not only vary from one browser to another, but also from one call to another.MediaStream object that have their kind attribute set to "video". The order is not defined, and may not only vary from one browser to another, but also from one call to another.MediaStream object, nothing happens.{{Specifications}}
{{Compat}}