The LocalMediaStream interface was part of the Media Capture and Streams API, representing a stream of data being generated locally (such as by getUserMedia(). However, getUserMedia() now returns a MediaStream instead, and this interface has been removed from the specification.

Documentation LocalMediaStream by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Methods

Inherited Variables

Defined by MediaStream

read onlyactive:Bool

A Boolean value that returns true if the MediaStream is active, or false otherwise.

read onlyid:String

A DOMString containing 36 characters denoting a universally unique identifier (UUID) for the object.

onaddtrack:Function

An EventHandler containing the action to perform when an addtrack event is fired when a new MediaStreamTrack object is added.

onremovetrack:Function

An EventHandler containing the action to perform when a removetrack event is fired when a  MediaStreamTrack object is removed from it.

Inherited Methods

Defined by MediaStream

addTrack(track:MediaStreamTrack):Void

Stores a copy of the MediaStreamTrack given as argument. If the track has already been added to the MediaStream object, nothing happens.

clone():MediaStream

Returns a clone of the MediaStream object. The clone will, however, have a unique value for MediaStream.id.

getAudioTracks():Array<AudioStreamTrack>

Returns a list of the MediaStreamTrack objects stored in the 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.

getTrackById(trackId:String):MediaStreamTrack

Returns the track whose ID corresponds to the one given in parameters, 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.

getTracks():Array<MediaStreamTrack>

Returns a list of all MediaStreamTrack objects stored in the 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.

getVideoTracks():Array<VideoStreamTrack>

Returns a list of the MediaStreamTrack objects stored in the 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.

removeTrack(track:MediaStreamTrack):Void

Removes the MediaStreamTrack given as argument. If the track is not part of the MediaStream` object, nothing happens.

Defined by EventTarget

addEventListener(type:String, listener:Function, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

addEventListener(type:String, listener:EventListener, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

Register an event handler of a specific event type on the EventTarget.

Throws:

null

DOMError

dispatchEvent(event:Event):Bool

Dispatch an event to this EventTarget.

Throws:

null

DOMError

removeEventListener(type:String, listener:Function, ?options:EitherType<EventListenerOptions, Bool>):Void

removeEventListener(type:String, listener:EventListener, ?options:EitherType<EventListenerOptions, Bool>):Void

Removes an event listener from the EventTarget.

Throws:

null

DOMError