
how to execute javascript afrer ned video?
Hi! How i can execute my own javascript after video end? i want execute test_myscrpt();
Hi! How i can execute my own javascript after video end? i want execute test_myscrpt();
http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference
onComplete
Thanks! But it don't work:( Can you help please? i add onComplete: 'test_myscrpt();', but it doesn't works. my code is:
<html>
<head>
<script src="http://jwpsrv.com/library/test.js"></script>
</head>
<body>
<div id='playertest'></div>
<div id='playertest'></div>
<script type='text/javascript'>
jwplayer('playertest').setup({
playlist: '//jwpsrv.com/feed/test.rss',
width: '100%',
aspectratio: '16:9',
onComplete: 'test_myscrpt();',
primary: 'flash'
});
</script>
</body>
</html>
Read the docs...
<html>
<head>
<script src="http://jwpsrv.com/library/test.js"></script>
</head>
<body>
<div id='playertest'></div>
<div id='playertest'></div>
<script type='text/javascript'>
jwplayer('playertest').setup({
playlist: '//jwpsrv.com/feed/test.rss',
width: '100%',
aspectratio: '16:9',
primary: 'flash' // WHY FLASH????!!
});
</script>
<script>
jwplayer().onComplete(function(){});
</script>
</body>
</html>
@mikhailtpm
You'll probably want to get rid of the duplicate "playertest" DIV as well:
<div id='playertest'></div>
@ben1189
There are many reasons why an embed may be forced to default to Flash:
> the version of JW Player / browser combination
and
> what's in the RSS playlist
Are just two potential reasons given this code.
You don’t necessarily need primary flash, it looks like you generated this code from the wizard though, so that option can always be toggled.
If you are using JW6.7,
Or the playlist contains YouTube videos after the first playlist item,
it would be sensible to default to flash...
It is probably 6.9 if using cloud hosted though.
Apologies...
> what's in the RSS playlist
Is just one potential reason given this code.
Yeah, it is possible that the wizard defaulted to Flash because of what’s in the RSS.
Ethan,
Just because the embed code is likely to be using 6.9 *now*, doesn't mean it was using 6.9 when the code was originally created - who knows, who cares - I was simple suggesting a couple of reasons why - given the code on offer - a user may actively chose to set the "primary" to "flash" - this was simply in a bid answer @ben1189's sub question.
None of this really matters.
As @ben1189 pointed out, the reason the code is not executing is because the event binding was done incorrect, and I was additionally suggesting the duplicate ID'ed DIV would not be helping matters.
James
Yeah, I understand :) Not trying to argue about that here :)
Yes, Ben’s observation is indeed correct.