简体   繁体   中英

Change the audio track on a video

I am trying to switch the audio language of a video.

With video.audioTracks I can see the list of the available tracks which looks like this

在此处输入图片说明

How can I access a track to enable/disable it? I tried video.audioTracks[0] but it returns an undefined.

Looks like you have a method to access an audio track from the AudioTrackList :

audioTracks.getTrackById(id) // get AudioTrack object by id

Source : HTML Audio/Video DOM audioTracks Property

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM