求js大佬,关于Video DOM currentTime 属性传值的问题
如何在<button>设置一个时间,如10秒后,自动将10秒传入<script>中myVid.currentTime里面执行。
<button onclick="setCurTime()" type="button">把时间位置设置为 5 秒</button>
<video id="video1" controls="controls">
<source src="/example/html5/mov_bbb.mp4" type="video/mp4">
</video>
<script>
myVid=document.getElementById("video1");
function setCurTime()
{
myVid.currentTime=5; //时间传入口
}
</script>