<!DOCTYPE html>
<html>
<body>
<video id="video1" controls="controls">
<source src="/example/html5/mov_bbb.mp4" type="video/mp4" e>
<source src="/example/html5/mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<script>
myVid=document.getElementById("video1");
myVid.play();
var num = 0 ;
myVid.addEventListener("ended", function()
{
num = num + 1;
myVid.play();
}
);
</script>
</body>
</html>
video标签的播发次数,很好统计,只要在播发结束时,给一个数字加1就行了
<html>
<body>
<video id="video1" controls="controls">
<source src="/example/html5/mov_bbb.mp4" type="video/mp4" e>
<source src="/example/html5/mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<script>
myVid=document.getElementById("video1");
myVid.play();
var num = 0 ;
myVid.addEventListener("ended", function()
{
num = num + 1;
myVid.play();
}
);
</script>
</body>
</html>
video标签的播发次数,很好统计,只要在播发结束时,给一个数字加1就行了