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

HTML JWplayer redirect to a URL when finish


Hello i actually find the code for the old jw and flash... but his may work in ipad, iphone etc,

http://www.longtailvideo.com/support/forums/jw-player/javascript-interaction/4711/redirect-after-intro/

I need to redirect to a URL when the video ends.. i think you do that with state monitor, but i dont know how to use it in the new html5 version, can you let me see an example

also i will like to put this video as a width=100% height=100% so i get full screen on all devices. but the http://account.longtailvideo.com/wizard wont let me use 100% so what can i do..

Do I force it via CSS.

9 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

This can be done with onComplete – http://www.longtailvideo.com/support/jw-player/28851/javascript-api-reference

JW Player

User  
0 rated :

I know, but how do you put it here is my code... i cant insert a redirect code inside onComplete

<body onload='jwplayer().play().setFullscreen(true).onComplete()'>
<div id='my-video'></div>
<script type='text/javascript'>
jwplayer('my-video').setup({
file: 'http://migisec.com/video/intro.mp4',
width: '',
height: ''
});
</script>
</body>

Ethan Feldman

JW Player Support Agent  
0 rated :

Make a separate script tag on the page:

<script type='text/javascript'> jwplayer().onComplete(function() {window.location = "http://www.cnn.com";}); </script>

JW Player

User  
0 rated :

And yes i found this http://www.longtailvideo.com/support/jw-player/28850/using-the-javascript-api but im just cant =(

tried onComplete: function(){document.location='www.youtube.com';}}, and other things.. not working

Ethan Feldman

JW Player Support Agent  
0 rated :

See my post above…………………………….

JW Player

User  
0 rated :

YEsss YOu goit !!! thanks

<script type='text/javascript'>
jwplayer().onComplete(function() {window.location = "http://www.cnn.com";});
</script>

JW Player

User  
0 rated :

jajaja thanks , but this dosent work on iPad, =(

not with full screen and onComplete. =( it actually just keep loading, in a small boz on the corner..

is there any special code for ipad??

JW Player

User  
0 rated :

Sorry that jajaja was because i was hoping this JWplayer fix an issue for what i need on IPAD,... and is just the same thing that fails again..

Actually i just manage to do what i need with youtube.. but i love JWplaer skin..

thanks anyway

Ethan Feldman

JW Player Support Agent  
0 rated :

np :)

This question has received the maximum number of answers.