案例:html/html5 案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html> 
2
<html> 
3
<body> 
4
5
<button onclick="getCurTime()" type="button">获得当前时间的位置</button>
6
<button onclick="setCurTime()" type="button">把时间位置设置为 5 秒</button>
7
<br />
8
<br />
9
<video id="video1" controls="controls">
10
  <source src="/example/html5/mov_bbb.mp4" type="video/mp4">
11
  <source src="/example/html5/mov_bbb.ogg" type="video/ogg">
12
  Your browser does not support HTML5 video.
13
</video>
14
15
<script>
16
myVid=document.getElementById("video1");
17
function getCurTime()
18
  { 
19
  alert(myVid.currentTime);
20
  } 
21
function setCurTime()
22
  { 
23
  myVid.currentTime=5;
24
  } 
25
</script> 
26
27
</body> 
28
</html>
29