JWPLAYER
by fredd man
HTML
<script src="https://embed-ssl.wistia.com/deliveries/51d8eb80d62661ab12b9c504608e719d.bin?disposition=attachment&filename=CaCb0lHw.js"></script>
<div id="player"></div>
<section>
<div class="seeker" data-start="0" data-end="5">Go to 0-5</div>
</section>
<section>
<div class="seeker" data-start="6" data-end="10">Go to 6-10</div>
</section>
JavaScript
jwplayer("player").setup({
file: "http://content.jwplatform.com/videos/C4lp6Dtd-el5vTWpr.mp4",
});
$(function(){
$("section").each(function(){
$(this).find(".seeker").on('click',function(){
var start = $(this).data('start'),
end = $(this).data('end');
jwplayer().play();
jwplayer().seek(start).onTime(function(event) {
if(event.position>end) {
jwplayer().stop();
}
});
// jwplayer().onBeforePlay(function(){
// jwplayer().seek(start).onTime(function(event) {
// if(event.position>end) {
// jwplayer().stop();
// }
// });
// });
});
});
});