I have used html5 video tag to for playing video. Once the complete video is played, i want to set the video current time to zero. If i use loop video will come to initial position and will be automatically played. I want to bring video to initial position but automatic playing is not required. How to achieve this?
Html is
<div class="video-wrapper" id="my-video" >
<video src="<?php echo asset_url().'videos/Video.mp4';?>" controlsList="nodownload" id="my-video"></video>
</div>
javascript is
$(document).ready(function() {
/**
* Video element
* @type {HTMLElement}
*/
var video = document.getElementById("my-video");
/**
* Check if video can play, and play it
*/
video.addEventListener("canplay", function(){
video.play();
});
});