编辑您的代码:提交代码

x
 
1
 
2
 
3
<!DOCTYPE html> 
4
<html> 
5
<body> 
6
7
<button onclick="getCurTime()" type="button">获得当前时间的位置</button>
8
<button onclick="setCurTime()" type="button">把时间位置设置为 5 秒</button>
9
<br />
10
<br />
11
<video id="video1" controls="controls">
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
17
<script>
18
myVid=document.getElementById("video1");
19
function getCurTime()
20
  { 
21
  alert(myVid.currentTime);
22
  } 
23
function setCurTime()
24
  { 
25
  myVid.currentTime=5;
26
  } 
27
</script> 
28
29
</body> 
30
</html>
31
            

查看结果:

请在上面的文本框中编辑您的代码,然后单击提交按钮测试结果。w3c0.com

W3c0.com 提供的内容仅用于培训。我们不保证内容的正确性。通过使用本站内容随之而来的风险与本站无关。W3c0 简体中文版的所有内容仅供测试,对任何法律问题及风险不承担任何责任。 当使用本站时,代表您已接受了本站的使用条款和隐私条款。版权所有,保留一切权利。 鲁ICP备15022115号