The removetrack
event is fired when a track is removed from a TextTrackList
.
The removetrack
event is fired when a track is removed from a TextTrackList
.
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("removetrack", (event) => {}); onremovetrack = (event) => {};
A TrackEvent
. Inherits from Event
.
In addition to the properties listed below, properties from the parent interface, Event
, are available.
Using addEventListener()
:
js
const mediaElement = document.querySelector("video, audio"); mediaElement.textTracks.addEventListener("removetrack", (event) => { console.log(`Text track: ${event.track.label} removed`); });
Using the onremovetrack
event handler property:
js
const mediaElement = document.querySelector("video, audio"); mediaElement.textTracks.onremovetrack = (event) => { console.log(`Text track: ${event.track.label} removed`); };
Specification |
---|
HTML Standard # event-media-removetrack |
HTML Standard # handler-tracklist-onremovetrack |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
removeTrack_event |
33 | 18 | 31 | No | 20≤12.1–15 | 7 | 4.4 | 33 | 31 | 20≤12.1–14 | 7 | 2.0 |
addtrack
, change
VideoTrackList
targets: removetrack
AudioTrackList
targets: removetrack
MediaStream
targets: removetrack
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/TextTrackList/removeTrack_event