You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using both dash and hls and it have both different apis. Therefore i try to use the native video method as much as possible to try and be more isomorphic. One of those methods is to listen when a text tracks have been found and when a user wants to change the selected track.
I'm not exactly sure how hls.js dose it but this work with hls.
you listen to video.textTracks.onaddtrack events (this lets you know that both hls and dash have found a TextTrack.)
Activating one if this tracks by setting track.mode = 'showing' will start to display the selected track.
I do not thing either dash or hls have downloaded the cues already (as they are lazy loaded?)
video.textTracks.onaddtrack=({track})=>{// add track to an select menuaddOptionToSelect(racks)}select.onchange=()=>{activeTrack.mode='disabled'// disable the previous trackconstselectedTrack=getTrackFrom(select)track.mode='showing'// activate the newly selected trackactiveTrack=track}
This works flawless in hls.js without calling any hls methods.
it seems like if hls.js are listening to TextTrackList.onchange and starts to download it accordingly (but not entirely sure how it works under the hood)
with dash.js i must call player.setTextTrack(index) manually for the cues to be populated
What i would kind of hope for in a feature request is that you would maybe deprecate setTextTrack & getTextTrack in favor of using the videos native TextTrackList methods instead so we don't have to call any isHLS ? hls.selectTrack(track) : dash.setTextTrack(index)
The text was updated successfully, but these errors were encountered:
I'm using both dash and hls and it have both different apis. Therefore i try to use the native video method as much as possible to try and be more isomorphic. One of those methods is to listen when a text tracks have been found and when a user wants to change the selected track.
I'm not exactly sure how hls.js dose it but this work with hls.
video.textTracks.onaddtrack
events(this lets you know that both hls and dash have found a TextTrack.)
track.mode = 'showing'
will start to display the selected track.I do not thing either dash or hls have downloaded the cues already (as they are lazy loaded?)
This works flawless in hls.js without calling any hls methods.
it seems like if hls.js are listening to TextTrackList.onchange and starts to download it accordingly (but not entirely sure how it works under the hood)
with dash.js i must call
player.setTextTrack(index)
manually for the cues to be populatedWhat i would kind of hope for in a feature request is that you would maybe deprecate
setTextTrack
&getTextTrack
in favor of using the videos native TextTrackList methods instead so we don't have to call anyisHLS ? hls.selectTrack(track) : dash.setTextTrack(index)
The text was updated successfully, but these errors were encountered: