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

onsetup error not happening


Is this code right, because on my tests it doesn't ever load anything,

}); <-- that is the end of the normal player setup and if I end here it works ok
​playerInstance.on('setupError', function(){
playerInstance.setup({
​playerInstance.load({file:"https://path/manifest.mpd",image:"https://path/poster_0001.jpg"});
playerInstance.play();});
});
</script>

6 Community Answers

mark

User  
0 rated :

I should mention I am testing this deliberately without a source file where it should be, thus, asking the player to fail to load and wanting the onsetuperror to setup with the new player

Cooper Reid

JW Player Support Agent  
1 rated :

That code does not look correct. You are passing a function call into the jwplayer().setup method. JWPlayer.setup expects an object with all of the configuration parameters. I think you need to be doing something like this

jwplayer(“player”).setup({
file: ‘stream1.mpd’,
title: ‘Bunny’,
image: ‘bunny.jpg’,
width:‘100%’
});

jwplayer(‘player’).on(‘setupError’, function() {
jwplayer(‘player’).load({file: ‘stream2.mpd’});
});

mark

User  
0 rated :

why are you confusing me with JW6 code when I am showing V7 code,
I tried it didn't work

Cooper Reid

JW Player Support Agent  
1 rated :

What? This is untrue. The event listener syntax I used is JW7.
Cooper

mark

User  
0 rated :

I thought you had to use playerinstance not jwplayer
Now I am even more confused

Cooper Reid

JW Player Support Agent  
2 rated :

You don’t have to, it’s simply the preferred method.

Cooper

This question has received the maximum number of answers.