Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. TextTrackList
  4. removetrack

TextTrackList: removetrack event

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨October 2018⁩.

Theremovetrack event is fired when a track is removed from aTextTrackList.

Syntax

Use the event name in methods likeaddEventListener(), or set an event handler property.

js
addEventListener("removetrack", (event) => { })onremovetrack = (event) => { }

Event type

ATrackEvent. Inherits fromEvent.

Event TrackEvent

Event properties

In addition to the properties listed below, properties from the parent interface,Event, are available.

trackRead only

TheTextTrack object to which the event refers.

Examples

UsingaddEventListener():

js
const mediaElement = document.querySelector("video, audio");mediaElement.textTracks.addEventListener("removetrack", (event) => {  console.log(`Text track: ${event.track.label} removed`);});

Using theonremovetrack event handler property:

js
const mediaElement = document.querySelector("video, audio");mediaElement.textTracks.onremovetrack = (event) => {  console.log(`Text track: ${event.track.label} removed`);};

Specifications

Specification
HTML
# event-media-removetrack
HTML
# handler-tracklist-onremovetrack

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp