I have a video in the middle of my html. As you can see at first I haven\'t any source
As above mentioned, you try to set currentTime when the video is not seekable. So, as an alternative use-case (reset time to 0 when a user click on a button, for example), you can do something like:
function resetVideo() {
myVid.pause();
if (myVid.seekable.length > 0) {
myVid.currentTime = 0;
}
}
Alternatively, you can also trying to reset only if the video has been played before.
function resetVideo() {
myVid.pause();
if (myVid.currentTime !== 0) {
myVid.currentTime = 0;
}
}