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

Examples

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`);
};

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
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

Legend

Full support  
Full support
No support  
No support

See also