coderef

Audio and video tracksLimited availability

The audioTracks and videoTracks APIs for media elements switch audio and video tracks during playback.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
✕Not supportedup to 155
Current: 155
Edge
✕Not supportedup to 154
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
1–7Not supported
8+Supportedsince Oct 16, 2014
Current: 27
MobileChrome Android
✕Not supportedup to 155
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
1–7Not supported
8+Supportedsince Sep 17, 2014
Current: 27

How to use

Not supported in Chrome, Edge, Firefox, Chrome Android, Firefox Android. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: AudioTrack.

Feature detection

JS · check before using
if ("AudioTrack" in globalThis) {
  // AudioTrack is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (27). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
AudioTrack✕✕✕8✕✕8
AudioTrack.enabled✕✕✕8✕✕8
AudioTrack.id✕✕✕8✕✕8
AudioTrack.kind✕✕✕8✕✕8
AudioTrack.label✕✕✕8✕✕8
AudioTrack.language✕✕✕8✕✕8
AudioTrackList✕✕✕7✕✕7
AudioTrackList.addtrack_event✕✕✕7✕✕7
AudioTrackList.change_event✕✕✕7✕✕7
AudioTrackList.getTrackById✕✕✕7✕✕7
AudioTrackList.length✕✕✕7✕✕7
AudioTrackList.removetrack_event✕✕✕7✕✕7
HTMLMediaElement.audioTracks✕✕✕7✕✕7
HTMLMediaElement.videoTracks✕✕✕7✕✕7
VideoTrack✕✕✕7✕✕7
VideoTrack.id✕✕✕7✕✕7
VideoTrack.kind✕✕✕7✕✕7
VideoTrack.label✕✕✕7✕✕7
VideoTrack.language✕✕✕7✕✕7
VideoTrack.selected✕✕✕7✕✕7
Show 7 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
VideoTrackList✕✕✕7✕✕7
VideoTrackList.addtrack_event✕✕✕7✕✕7
VideoTrackList.change_event✕✕✕7✕✕7
VideoTrackList.getTrackById✕✕✕7✕✕7
VideoTrackList.length✕✕✕7✕✕7
VideoTrackList.removetrack_event✕✕✕7✕✕7
VideoTrackList.selectedIndex✕✕✕7✕✕7