VideoTrackList: removetrack イベント
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
removetrack
イベントは、トラックが VideoTrackList
から取り除かれたときに発生します。
構文
このイベント名を addEventListener()
などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。
js
addEventListener("removetrack", (event) => {});
onremovetrack = (event) => {};
イベント型
TrackEvent
です。 Event
から継承しています。
イベントプロパティ
下記に挙げたプロパティに加えて、親インターフェイスである Event
のプロパティも利用できます。
track
読取専用-
イベントが参照している新しく追加された
VideoTrack
。
例
addEventListener()
を使用する場合
js
const videoElement = document.querySelector("video");
videoElement.videoTracks.addEventListener("removetrack", (event) => {
console.log(`Video track: ${event.track.label} removed`);
});
onremovetrack
イベントハンドラープロパティを使用する場合
js
const videoElement = document.querySelector("video");
videoElement.videoTracks.onremovetrack = (event) => {
console.log(`Video track: ${event.track.label} removed`);
};
仕様書
Specification |
---|
HTML # event-media-removetrack |
HTML # handler-tracklist-onremovetrack |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
removetrack event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
- 関連イベント:
addtrack
,change
AudioTrackList
を対象としたこのイベント:removetrack
MediaStream
を対象としたこのイベント:removetrack
- メディアキャプチャとストリーム API
- WebRTC