如何使用html5重置视频 [英] How to Reset video using html5
本文介绍了如何使用html5重置视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对网络编程有些陌生,因此我试图弄清楚如何在首次播放后重设视频.我的代码是:
I'm kind of new with programming in web and I'm trying to figure out how to reset the video after playing it for the first time. My code is:
var video = document.getElementById('home_video');
video.addEventListener('click',function(){
video.play();
},false);
谢谢!
推荐答案
我相信您可以使用类似这样的东西:
I believe you can use something like this:
var video = document.getElementById('home_video');
video.addEventListener('click',function(){
video.currentTime = 0
video.play();
},false);
这篇关于如何使用html5重置视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文