Home > hls.js > Hls > setAudioOption

Hls.setAudioOption() method

Find and select the best matching audio track, making a level switch when a Group change is necessary. Updates hls.config.audioPreference. Returns the selected track, or null when no matching track is found.

Signature:

setAudioOption(audioOption: MediaPlaylist | AudioSelectionOption | undefined): MediaPlaylist | null;

Parameters

Parameter Type Description
audioOption MediaPlaylist | AudioSelectionOption | undefined

Returns:

MediaPlaylist | null