The HTML5 video element gets you started using video elements on your webpages. With the addition of JavaScript, you can programmatically create custom playback controls, get and set the current playing position, and change the current video. You can also apply execution time.
Your HTML changes:
<video controls preload="metadata" id="Video1">
<source src="http://example.com/myvideo.mp4" type="video/mp4">
</video>
JS code:
var video = document.getElementById("Video1");
if (video.canPlayType) { // tests that we have HTML5 video support
video.addEventListener("canplay", function(){
setTime(483); //specified time
}, false);
}
setTime function:
function setTime(tValue) {
// if no video is loaded, this throws an exception
try {
if (tValue == 0) {
video.currentTime = tValue;
}
else {
video.currentTime += tValue;
}
} catch (err) {
// errMessage(err) // show exception
console.log("Video content might not be loaded");
}
}
You can get more details at Using JavaScript to control the HTML5 video player