VideoTrackList: removetrack event

The removetrack event is fired when a track is removed from a VideoTrackList.

Bubbles No
Cancelable No
Interface TrackEvent
Event handler property onremovetrack

Examples

Using addEventListener():

const videoElement = document.querySelector('video');

videoElement.videoTracks.addEventListener('removetrack', (event) => {
  console.log(`Video track: ${event.track.label} removed`);
});

Using the onremovetrack event handler property:

const videoElement = document.querySelector('video');

videoElement.videoTracks.onremovetrack = (event) => {
  console.log(`Video track: ${event.track.label} removed`);
};

Specifications

Browser compatibility

BCD tables only load in the browser

See also