案例:html/html5 案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html> 
2
<html> 
3
<body> 
4
5
<button onclick="enableLoop()" type="button">启用循环</button>
6
<button onclick="disableLoop()" type="button">禁用循环</button>
7
<button onclick="checkLoop()" type="button">检查循环的状态</button>
8
<br />
9
<br />
10
<video id="video1" controls="controls">
11
  <source src="/example/html5/mov_bbb.mp4" type="video/mp4">
12
  <source src="/example/html5/mov_bbb.ogg" type="video/ogg">
13
  Your browser does not support HTML5 video.
14
</video>
15
16
<script>
17
myVid=document.getElementById("video1");
18
function enableLoop()
19
  { 
20
  myVid.loop=true;
21
  myVid.load();
22
  } 
23
function disableLoop()
24
  { 
25
  myVid.loop=false;
26
  myVid.load();
27
  } 
28
function checkLoop()
29
  { 
30
  alert(myVid.loop);
31
  } 
32
</script> 
33
34
</body> 
35
</html>
36