Vadim Tatarnikov Vadim Tatarnikov - 1 year ago 184
Javascript Question

restart html video with javascript

I have a tag in my html code with a locally stored video in it (not a link from youtube). I know there is a way to play/pause the video from javascript by using

. Lets say I have a button that I would like to reset the video (skip to beginning). Is there a function for that in javascript/ jquery? If not then how can I achieve this?

Thanks to everyone in advance.

Answer Source

You can use currentTime property as follow

var vid = document.getElementById("myVideo");
vid.currentTime = 0;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download