案例:html/html5 案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html> 
2
<html> 
3
<body> 
4
5
<button onclick="enablePreload()" type="button">启用预加载</button>
6
<button onclick="disablePreload()" type="button">禁用预加载</button>
7
<button onclick="checkPreload()" 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 enablePreload()
19
  { 
20
  myVid.preload="auto";
21
  } 
22
function disablePreload()
23
  { 
24
  myVid.preload="none";
25
  } 
26
function checkPreload()
27
  { 
28
  alert(myVid.preload);
29
  } 
30
</script> 
31
32
</body>
33
</html>
34