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 () {
|
setInterval(function () {
|
||||||
position.innerHTML = asTime(this.currentTime);
|
position.innerHTML = asTime(video.currentTime);
|
||||||
|
|
||||||
// ctx.restore();
|
// ctx.restore();
|
||||||
ctx.drawImage(video, 0, 0, video.width, video.height, 0, 0, canvas.width, canvas.height);
|
ctx.drawImage(video, 0, 0, video.width, video.height, 0, 0, canvas.width, canvas.height);
|
||||||
});
|
}, 1000 / 15);
|
||||||
|
|
||||||
addEvent(video, 'ended', function () {
|
addEvent(video, 'ended', function () {
|
||||||
togglePlay.value = "play";
|
togglePlay.value = "play";
|
||||||
|
@ -92,4 +92,4 @@ function two(s) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue