Html5 video.currentTime 冻结玩家
Html5 video.currentTime freezes player
我正在尝试使用 currentTime
跳过视频。
我的视频是这样设置的:
<style>
#video-player {
display:inline-block;
width:500px;
height:358px;
margin-left:20px;
}
</style>
<video id="video-player" controls autoplay>
<source src="messi.mp4" type="video/mp4">
</video>
稍后,我在按钮上设置了点击事件。
var video = document.getElementById('video-player');
video.currentTime = parseInt(video.currentTime) - 2;
我只希望该按钮能够将视频及时后退 2 秒。
但是当我点击时,它要么将视频移动到开头,然后将其冻结。
所以这很奇怪,但是当我在现场测试我的代码时问题就消失了 url。
我在使用本地 Python Web 服务器进行测试时遇到了问题。希望这对某人有所帮助。
我正在尝试使用 currentTime
跳过视频。
我的视频是这样设置的:
<style>
#video-player {
display:inline-block;
width:500px;
height:358px;
margin-left:20px;
}
</style>
<video id="video-player" controls autoplay>
<source src="messi.mp4" type="video/mp4">
</video>
稍后,我在按钮上设置了点击事件。
var video = document.getElementById('video-player');
video.currentTime = parseInt(video.currentTime) - 2;
我只希望该按钮能够将视频及时后退 2 秒。
但是当我点击时,它要么将视频移动到开头,然后将其冻结。
所以这很奇怪,但是当我在现场测试我的代码时问题就消失了 url。
我在使用本地 Python Web 服务器进行测试时遇到了问题。希望这对某人有所帮助。