dash.js icon indicating copy to clipboard operation
dash.js copied to clipboard

How do you reset vtt.js tracks after changing video with player.attachSource() ?

Open dsilhavy opened this issue 1 year ago • 4 comments

Discussed in https://github.com/Dash-Industry-Forum/dash.js/discussions/4219

Originally posted by Eeel-12 July 8, 2023 Hi,

With dash.js 4.7.1 i use player.attachSource(manifest.mpd) to change video on a same page without initializing the whole player, this works fine with customRenderingEnabled: false

With vtt.js enable when switching to another video with player.attachSource(manifest.mpd) the player render the new vtt track and the one from the previous video.

I tried to destroy the player with no luck, after initialize() vtt.js continue to render all the vtt tracks.

How can i "reset" vtt.js before loading a new video with player.attachSource() without re loading the whole player ?

dsilhavy avatar Jul 09 '23 06:07 dsilhavy

Fixed in #4224 , can you confirm that the problem is solved in the nightly version: https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

dsilhavy avatar Jul 12 '23 16:07 dsilhavy

Hi, Thank you for the fix, i confirm it works fine, while i was testing i realise that on some videos subtitles are not displayed, this did not happen with customRenderingEnabled: false but maybe it's something with my js code? I have removed all my unecessary Js and created a pen with the nightly build and The Big Buck Bunny here click on the button video 1 then video 2, subtitles are not visible in the second video, with customRenderingEnabled: false subtitles are always visible no matter how fast you switch from video.

Eeel-12 avatar Jul 17 '23 16:07 Eeel-12

@Eeel-12 Can you also reproduce this error in our reference UI? http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

dsilhavy avatar Sep 11 '23 12:09 dsilhavy

@dsilhavy thank you.

A Pen is available here using nightly in settings. It is better but the issue still exist. For video 1 & 2, the first caption is at 4s and the second at 17s, on 'video 1' click, caption is working, on 'video 2' click the first caption at 4s is never shown but the one at 17s and after is working fine. On 'video 3' button it's the dash.js Elephant dream, on click,caption don't show at all (timecode is at 20, 18, 20, 22 ...) If 'video 3' is clicked first, caption works fine.

Hope that help,

Eeel-12 avatar Sep 13 '23 17:09 Eeel-12