Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I switch audio track during playback

I load content from the following manifest using dash.js into an HTML5 video: MPD file. It contains one video and four audio tracks. I'm trying to figure out how I can enumerate and enable/disable the different audio tracks available.

I understand that if they were added as TRACK elements to the VIDEO element I could enable/disable them through video.audioTracks but that isn't possible as they are loaded from the manifest.

Any pointers as to how I could solve this would be greatly appreciated.

like image 375
HSBallina Avatar asked Nov 01 '22 06:11

HSBallina


1 Answers

videoObject.audioTracks[audioTrackIndex].enabled = true;
like image 181
Jeoffrey Mendez Avatar answered Nov 08 '22 04:11

Jeoffrey Mendez