MediaStream
Summary
The MediaStream interface is used to represent streams of media data, typically (but not necessarily) of audio and/or video content, e.g. from a local camera. Each MediaStream object can contain zero or more tracks, in particular audio and video tracks. And each track in a MediaStream object has a corresponding MediaStreamTrack object.
Properties
- ended
- Is true if the MediaStream has finished, false otherwise.
- id
- A globally unique identifier string, initialized when the MediaStream object is created.
- onaddtrack
- Handles the addtrack event when fired on the MediaStream object.
- onended
- Handles the ended event when fired on the MediaStream object.
- onremovetrack
- Handles the removetrack event when fired on the MediaStream object.
Methods
No methods.
Events
- addtrack
- This event is fired when a track is added to the MediaStream.
- removetrack
- This event is fired when a track is removed from the MediaStream.
- ended
- This event is fired when a MediaStream is stopped.
Related specifications
- Media Capture and Streams
- W3C Working Draft