synced video to playback rate rather than timeupdate event
This commit is contained in:
parent
0ccf76148a
commit
3784b065a3
|
@ -40,12 +40,12 @@ addEvent(togglePlay, 'click', function () {
|
|||
}
|
||||
});
|
||||
|
||||
addEvent(video, 'timeupdate', function () {
|
||||
position.innerHTML = asTime(this.currentTime);
|
||||
setInterval(function () {
|
||||
position.innerHTML = asTime(video.currentTime);
|
||||
|
||||
// ctx.restore();
|
||||
ctx.drawImage(video, 0, 0, video.width, video.height, 0, 0, canvas.width, canvas.height);
|
||||
});
|
||||
}, 1000 / 15);
|
||||
|
||||
addEvent(video, 'ended', function () {
|
||||
togglePlay.value = "play";
|
||||
|
@ -92,4 +92,4 @@ function two(s) {
|
|||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue