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

Play an ad after the playlist completes

I'd like to play an ad after my playlist finishes. I've set up a listener for the playlistComplete event and I'm calling playAd on the player instance but the player just hangs and shows the 'Loading Ad' text in the control bar.

I think this is because once the playlist finishes the player no longer has a src attribute, so the player stops functioning.

Is there any way to play an ad once my playlist has ended?

1 Community Answers


JW Player Support Agent  
0 rated :

Use on(‘beforeComplete’)
get the index of the currently playing item .getPlaylistIndex().
Check if you’re at the last playlist item. .getPlaylist().length -1

This question has received the maximum number of answers.