Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.15k stars 1.68k forks source link

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

Open dsilhavy opened 1 year ago

dsilhavy commented 1 year ago

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 commented 1 year ago

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

Eeel-12 commented 1 year ago

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.

dsilhavy commented 1 year ago

@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

Eeel-12 commented 1 year ago

@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,