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

Show other playlist item on error

Hello, when player can't play source it will generate onError event. In that event I want to show next playlist item. Player only changes info but does not start playing this new item.

jwplayer("myvideo").on('error', function (message) {
.playlistItem(currIndex + 1) // Changes information, like Title and description, still can see exclamation mark

When doing `.load({file: url})` it's working, but removing all playlists.
Any ideas how to fix that? Using JW v7.2.4

4 Community Answers


JW Player Support Agent  
1 rated :

Hi, there.

You should be able to accomplish this by using the .getPlaylistIndex() and .playlistItem() calls like this:

var playerInstance = jwplayer("myvideo");

playerInstance.on("error", function() {
  var currentIndex = playerInstance.getPlaylistIndex();
  var nextIndex = currentIndex + 1;

I’ve tested this on my local environment and it worked.


0 rated :

Is it possible to have associated array as playlists? {"48":{...}, "56": {...}} or do I have to keep it as indexed array?


0 rated :

I have simulated most simple example. Still not working.
Output from console:

12:59:27.699 Runing player with #0
12:59:28.269 HTTP "Content-Type" of "video/quicktime" is not supported. Load of media resource failed.
12:59:28.283 Error playing media: MediaError { code: 4 } "" jwplayer.js:1:16380
12:59:28.285 Runing player with #1

My code:

$(document).ready(function () {
console.log('--START OF TEST--');

playerInstance = jwplayer("myvideo").setup({
width: $("#video").width(),
height: 365,
playlist: playlistsJson,
autostart: false


playerInstance.on('error', function (message) {

function test(index) {
console.log('Runing player with #'+index);


As you can see on second video I do not receive any errors. But still on player I see correct title with exclamation mark and no video playing.

What am I doing wrong?


JW Player Support Agent  
0 rated :

I did not see any videos attached. Can you please give me a link to a page where you have the affected player installed? That will help me troubleshoot your issue.

Thank you.

This question has received the maximum number of answers.