HTML5 reset video and play again
While Stichy posted a sufficient answer to his own question, the method video.load()
causes unnecessary bandwidth to be used as it reloads the video from the server.
Loading videos in particular can pose a heavy load on the server. Consider you could possibly be loading many megabytes each time the video is replayed.
There is also a short period where the user needs to wait for the video to re-download as well.
The solution I have found that works most efficient and smooth is by simply pausing the video before changing the currenttime
property.
Like so:
video.pause();
video.currentTime = 0;
video.play();
This solved it! I changed the video.currentTime = 0;
to:
video.load();