stop a video jquery 1

stop a video jquery

$('#playButton').click(function(event){
  $('#theVideo').get(0).play(); 
  setTimeout(function(){
    $('#theVideo').get(0).pause();
    $('#theVideo').get(0).currentTime = 0;
  }, 7000);
});

Here is what the above code is Doing:
1. When the user clicks the play button, the video starts playing.
2. After 7 seconds, the video pauses and the current time is set to 0.

Similar Posts