Audio Tracks Events

These API calls are used to listen to or update the audio track if multiple audio tracks of a video are provided.


.on('audioTracks')

Fired when the list of available audio tracks is updated. Happens shortly after a playlist item starts playing.

Returns an object with the following:

ValueDescription
levels arrayAn array containing the new audio track objects

Returns the same information as getAudioTracks()

.on('audioTrackChanged')

Fired when the active audio track is changed.

Happens in response to e.g. a user clicking the audio tracks menu or a script calling setCurrentAudioTrack().

Returns an object with the following:

ValueDescription
currentTrack numberIndex of the new quality level in the getAudioTracks() array.