1

I have a webpage, where i only need to show the first 15 seconds of a video, inside a bootstrap modal box. I have already made box load the video, but i need it, to only load 15 seconds?

I used this example to load the video: http://jsfiddle.net/n90Lexgc/

$('.js-play').click(function(){

      var vid_num = $(this).data('vid');
      var vid_src = 'https://player.vimeo.com/video/'+vid_num;
      $('#myModal').modal('show');
      $('#myModal iframe').attr('src', vid_src);
  })

1 Answers1

0

This code will work:

player.on('timeupdate', function(data) {
  if (data.seconds > 15) {

    player.pause().then(function(){
       video01Player.setCurrentTime(0);
    });
  }
});
Ale DC
  • 1,646
  • 13
  • 20