Note: This feature is available in Dedicated Web Workers.
The selectedIndex property of the ImageTrackList interface returns the index of the selected track.
An integer.
The following example prints the value of selectedIndex to the console.
let tracks = imageDecoder.tracks;
console.log(tracks.selectedIndex);