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

Only play sections of a video


How do I make a video hosted on the JW Platform play from (say) 15secs to 45secs? Is this even possible?

5 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

You would use the API.

Basically onBeforePlay(), have the player seek() 15 seconds.

And then you can use onTime() and say when the time is 45 seconds, to stop()

http://www.longtailvideo.com/support/jw-player/28851/javascript-api-reference

alisoncattermole

User  
0 rated :

I'm not a programmer. Can you give me an actual code snippet that would work with this embed code:

<script type="text/javascript" src="http://content.bitsontherun.com/players/xxxxxxxx-xxxxxxxx.js"></script>

Thanks

Ethan Feldman

JW Player Support Agent  
1 rated :

Put this under that line of code:

<script type='text/javascript'> jwplayer().onBeforePlay(function() { jwplayer().seek(15); }); jwplayer().onTime(function(event) { if (event.position >= 45) {jwplayer().stop();} }); </script>

alisoncattermole

User  
0 rated :

Thanks very much, Ethan!

Ethan Feldman

JW Player Support Agent  
0 rated :

Np!

This question has received the maximum number of answers.