Closed hector closed 5 years ago
Try setting AUTOSELECT to YES
Surprisingly you got the DEFAULT option to work (on bitmovin). They renamed the option in production to is_default last tuesday
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="English",DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="en",URI="video_audio_track_english.m3u8"
Thanks for the suggestion!
Still, it does not make it work :(
Could someone at least tell me if this is a problem of my m3u8 or videojs-contrib-hls behaviour? If it is the latter I can try to dig into the code.
I have been able to make this work with the new version 7 of video.js which uses https://github.com/videojs/http-streaming instead of videojs-contrib-hls.
@hector : can you share the solution here (i.e jsfiddle)? how you have switch audio quality using default/autoselect? I have written as below, but it's not working.
player.tech_.hls.masterPlaylistController_.mediaTypes_.AUDIO.groups[name][0].autoselect=true
player.tech_.hls.masterPlaylistController_.mediaTypes_.AUDIO.groups[name][0].default=true
I do it like this:
// Change audio track
const audioTrack = player.audioTracks().tracks_.find(track => track.language === language);
if (audioTrack) audioTrack.enabled = true;
I suggest you first pause the video in case it is playing, then play it again.
@hector : I am asking about audio quality not audio track. I have 2 audio quality/group i.e stereo and surround. how to switch quality stereo/surround. I have already handled audio track switch i.e english and dubbing.
see the below link there is audio quality option. I am talking about it. https://bitmovin.com/demos/stream-test?format=hls&manifest=https%3A%2F%2Fbitdash-a.akamaihd.net%2Fcontent%2Fsintel%2Fhls%2Fplaylist.m3u8
This issue was about having videojs play multiple audios (e.g. with different languages) without a video. Not about different qualities for the same audio. That's a different thing, I don't know how to do what you ask because I use a single quality in my audios.
ok thanks hector
@heff : can you help?
@murtaz53 can you open a new detailed issue about the problem? What you're doing, what you're expecting, what's happening etc.
@gkatsev : I have open a new detailed issue about the problem #1450
Description
I am trying to play an audio with multiple renditions, e.g. I attach an example were the main audio is in French and I have an alternate audio in English. videojs-contrib-hls is playing the main audio (French) correctly, it is also reading correctly that there are two languages (showing them in the control bar) but when selecting the alternate rendition (English) the audio will not change. I don't know if this is a feature that is lacking or I should write a different M3U8 file.
Test case: http://jsbin.com/yijitogoji/1/edit?html,output
The same M3U8 is working in this other player: https://bitmovin.com/hls-mpeg-dash-test-player/
M3U8 link: https://s3-eu-west-1.amazonaws.com/media.voctrolabs/development/voiceful_studio/rice/audio.m3u8
M3U8 is like this:
Results
Expected
I should be able to change the audio.
Error output
No errors thrown.
Additional Information
I tried to follow this words from the HLS specification: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.4.2.1
The same audio files but including a video work fine; example: http://jsbin.com/jovoralubu/1/edit?html,output
videojs-contrib-hls version
videojs-contrib-hls 5.12.2
videojs version
video.js 6.4.0
Browsers
Platforms
Other Plugins
No