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

Set Non Autoplay Playlist Index


I am trying to setup a player that does not autoplay, and has a playlist of 10 items, where i would like the 3rd item to be the first item to play.

I have explored 2 options for how to make this work:

1) call jwplayer().playlistItem(2) in the FIRST onPlaylistItem callback

2) call jwplayer().playlistItem(2) in the FIRST onPlay callback

Issues with option 1: is that I can use a flag to detect when the player trys to set the playlistitem for the first time and then force the playlist to start on the 3rd item. The problem is this then starts the player playing, and we see a flash of the thumbnail for the first item (not really a big problem)

Issues with option 2: is that I can use a flag to detect when the player has started playing for the first time and then force the playlist to start on the 3rd item. This works fine. The downside is then the 'thumbnail' on the 'stopped' player is that of the first item.

I am looking for a way to have the 3rd item be the first video to play, and have its thumbnail be the visible when the player is in the stopped state.

Is there a way to do this without having to be really 'hacky' and calling `jwplayer().stop()` after setting the playlist index?

PS. I can see a similar question has been asked in regards to mobile playlist stuff here: http://support.jwplayer.com/customer/portal/questions/8547131-start-on-specific-playlist-index- but the answer was never published if one was found

3 Community Answers

studio

User  
-1 rated :

if this isnt in the current functionality list, it would be awesome to have the .playlistItem() function be extended to include an optional second parameter that stops playback.

For example:

.playlistItem(2);
.playlistItem(2, true);

both switch to the 3rd item and begin playback

.playlistItem(2, false);

switches to the 3rd item and does NOT initiate playback

Todd

JW Player Support Agent  
-1 rated :

You can jump to the third video of the playlist in an onReady() call:

jwplayer().onReady(function(){
jwplayer().playlistItem(2);
});

but that will not help with your image being visible. The best option I can think of for that is to build a custom playlist listbar and do the following:

-set the desired poster image as the image for the first video
-hack your playlist listbar to show the correct image for the first video instead of the image for the third video

See my sample custom listbar page at http://qa.jwplayer.com/~todd/playlist-custom-listbar.html for a code example.

studio

User  
1 rated :

Thanks Todd,

as i mentioned playlistItem(2) automatically starts playback though. So I cant call playlistItem(2) in the onReady function. At least not without immediately having to stop/pause the player.. which is difficult if you're trying to schedule preroll ads before a video.

it would be great to see the playlistItem function extended to allow non-auto playback begin

This question has received the maximum number of answers.