Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Multiple chapters loaded when jumping to certain playlist item


Hi,

There seems to be a little bug when dealing with playlists where the videos have chapters.
I have such a playlist and upon opening the player I need to jump to a different file in the playlist and play that one. In this scenario the player opens in a modal.

After the call to playlistItem(index) the video loads with the content of 2 .vtt chapter files: the .vtt from the first item in the playlist and the one belonging to the loaded video. This only happens if the call to playlistItem(index) is placed before the first vtt file is finished loading. I have tried moving the call to playlistItem(index) as late as possible (onReady, onPlaylist, onPlaylistItem) but none worked.

We had a quick look at the player code and we think the problem can be solved by adding a call to removeCues every time a vtt file is done loading:
function _cueLoaded(xmlEvent) {
_removeCues();

Is there a quick workaround that we could use? Or is there something we are doing wrong?

Thank you!

2 Community Answers

Cooper Reid

JW Player Support Agent  
0 rated :

Can you show me a page where the bug is taking place? I’ve never encountered this type of issue before. A couple of quick fixes that come to mind -

using a settimeout:
setTimeout(function() { jwplayer().playlistItem(index); }, 50); // short timeout

doing the playlistItem(index) in an onPlay

-Cooper

alex

User  
0 rated :

I already tried the setTimeout trick, however that is not a reliable solution as the files can take long to arrive on mobile with bad connections. And the files can come in any order, so it is even possible for the wrong file to load.

I will try and make a demo page when I have some time.

This question has received the maximum number of answers.