Skip to content Skip to sidebar Skip to footer

How To Reset Video Using Html5

I'm kind of new with programming in web and I'm trying to figure out how to reset the video after playing it for the first time. My code is: var video = document.getElementById('ho

Solution 1:

I believe you can use something like this:

var video = document.getElementById('home_video');
    video.addEventListener('click',function(){
    video.currentTime = 0
    video.play();
    },false);

Solution 2:

I think you should be able to do it with video.currentTime = 0;

http://www.w3schools.com/tags/av_prop_currenttime.asp

Solution 3:

Add video.load();

Your Code after changes:

var video = document.getElementById('home_video');
  video.addEventListener('click',function(){
  video.load();
  video.play();
  },false);

Post a Comment for "How To Reset Video Using Html5"