当媒体的播放位置已更改为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 元宵贺卡祝福语结婚简短
18 六一互换礼物祝福语简短