Ghvzqvfnwrrnt
New Member
\[code\]jwplayer("myElement_0").onPlay(function(){ pausePlayers(1); alert('0 has started'); });jwplayer("myElement_1").onPlay(function(){ pausePlayers(2); alert('1 has started'); });jwplayer("myElement_2").onPlay(function(){ pausePlayers(3); alert('2 has started'); });jwplayer("myElement_3").onPlay(function(){ pausePlayers(4); alert('3 has started'); });function pausePlayers(playing) { for (var i=0; i<4; i++) { if(i != playing) { jwplayer("myElement_"+i).pause(true); } }};\[/code\]I have this script to pause other players if one is running. but it doesn't work. In my console, I see:\[code\]Uncaught TypeError: Object #<Object> has no method 'onPlay'(anonymous function)\[/code\]alhouthgh I'm pretty sure the jwplayer script is being loaded, no issues there.