Web/API/MediaStream/addTrack

From Get docs

The MediaStream.addTrack() method adds a new track to the stream. The track is specified as a parameter of type MediaStreamTrack.

If the specified track is already in the stream's track set, this method has no effect.


Syntax

stream.addTrack(track);

Parameters

track
A MediaStreamTrack to add to the stream.

Return value

undefined

Example

 

Specifications

Specification Status Comment
Media Capture and StreamsThe definition of 'addTrack()' in that specification. Candidate Recommendation Initial specification.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
addTrack Chrome

Full support 26

Edge

Full support 12

Firefox

Full support 44

IE

No support No

Opera

No support No

Safari

Full support Yes

WebView Android

Full support 37

Chrome Android

Full support 26

Firefox Android

No support No

Opera Android

No support No

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.5

Legend

Full support  
Full support
No support  
No support


See also