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

JWPlayer setup() is it mandatory to have it before listening to player events ?


Hi ,

I am embedding jwplayer in my html page . The jwplayer.on() listeners is behaving differently in google chrome and MAC Safari .

In google chrome the jwplayer().on("playlistItem", function() listener if called before jwplayer().setup() works fine .

if the same html page loaded on safari is throwing TypeError: jwplayer().on is not a function. (In 'jwplayer().on', 'jwplayer().on' is undefined)

when i added jwplayer().setup() just before jwplayer().on("playlistItem", function() it worked in both chrome and safari .

The question is , is it mandatory to have jwplayer().setup() before the listening to the player events ? If so why it is working in google chrome and not in safari ?
Thanks

1 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

You should in general call setup before assigning the listeners. It seems to be a question of if the browser has loaded the script yet or not and if jwplayer() exists.

This question has received the maximum number of answers.