当媒体的播放位置已更改为HTML时执行脚本?
该ontimeupdate属性事件触发时媒体的播放位置,例如,视频,被改变。它可以在视频或音频中快进或快退。
示例
您可以尝试运行以下代码实现ontimeupdate属性-
<!DOCTYPE html>
<html>
<body>
<h2 id="test">Play</h2>
<video id = "myid" width="320" height = "176" controls ontimeupdate = "myFunction()">
<source src = "/html5/foo.ogg" type = "video/ogg" />
<source src = "/html5/foo.mp4" type = "video/mp4" />
Your browser does not support the video element.
</video>
<script>
function myFunction() {
document.getElementById("test").innerHTML = "Current position: " +
document.getElementById("myid").currentTime;
}
</script>
</body>
</html>热门推荐
10 奶茶便利贴祝福语简短
11 生日祝福语简短女友英语
12 给儿子新婚祝福语简短
13 保洁阿姨送来祝福语简短
14 女士简短祝福语大全集
15 对女儿生日祝福语简短
16 最新高考祝福语 简短
17 上班祝福语简短10字
18 学校校长新年祝福语简短