function getTrackList(el) {
const trackList = [];
const wantedKinds = [
"main",
"alternative",
"main-desc",
"translation",
"commentary",
];
el.audioTracks.forEach((track) => {
if (wantedKinds.includes(track.kind)) {
trackList.push({
id: track.id,
kind: track.kind,
label: track.label,
});
}
});
return trackList;
}AudioTrack: label property / notebook
AudioTrack: label property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.