案例:html5案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html> 
2
<html> 
3
<body> 
4
5
<div style="text-align:center;">
6
  <button onclick="playPause()">播放/暂停</button> 
7
  <button onclick="makeBig()"></button>
8
  <button onclick="makeNormal()"></button>
9
  <button onclick="makeSmall()"></button>
10
  <br /> 
11
  <video id="video1" width="420" style="margin-top:15px;">
12
    <source src="/example/html5/mov_bbb.mp4" type="video/mp4" />
13
    <source src="/example/html5/mov_bbb.ogg" type="video/ogg" />
14
    Your browser does not support HTML5 video.
15
  </video>
16
</div> 
17
18
<script type="text/javascript">
19
var myVideo=document.getElementById("video1");
20
21
function playPause()
22
{ 
23
if (myVideo.paused) 
24
  myVideo.play(); 
25
else 
26
  myVideo.pause(); 
27
} 
28
29
function makeBig()
30
{ 
31
myVideo.width=560; 
32
} 
33
34
function makeSmall()
35
{ 
36
myVideo.width=320; 
37
} 
38
39
function makeNormal()
40
{ 
41
myVideo.width=420; 
42
} 
43
</script> 
44
45
</body> 
46
</html>
47