MediaStream: removetrack event

The removetrack event is fired when a new MediaStreamTrack object has been removed from a MediaStream.

Bubbles No
Cancelable No
Interface MediaStreamTrackEvent
Event handler property onremovetrack


Using addEventListener():

let stream = new MediaStream();

stream.addEventListener('removetrack', (event) => {
  console.log(`${event.track.kind} track removed`);

Using the onremovetrack event handler property:

let stream = new MediaStream();

stream.onremovetrack = (event) => {
  console.log(`${event.track.kind} track removed`);


Specification Status
Media Capture and Streams
The definition of 'removetrack' in that specification.
Candidate Recommendation

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
removetrack eventChrome Full support YesEdge Full support 12Firefox No support NoIE No support NoOpera No support NoSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android No support NoSafari iOS Full support YesSamsung Internet Android Full support Yes


Full support Ā 
Full support
No support Ā 
No support

See also