You can detect when tracks are removed from a media element by either setting the track's onremovetrack event handler directly, or by using AudioTrackList.addEventListener() on the track list object. For example, to watch for audio tracks to be removed from a video element: