synced video to playback rate rather than timeupdate event

This commit is contained in:
remy 2011-04-25 20:36:07 +01:00
parent 0ccf76148a
commit 3784b065a3
1 changed files with 4 additions and 4 deletions

View File

@ -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>