From 3784b065a37def055aa2c75d0fa47e948513fd65 Mon Sep 17 00:00:00 2001 From: remy Date: Mon, 25 Apr 2011 20:36:07 +0100 Subject: [PATCH] synced video to playback rate rather than timeupdate event --- video-canvas.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/video-canvas.html b/video-canvas.html index 5f58b66..73245ba 100644 --- a/video-canvas.html +++ b/video-canvas.html @@ -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) { } - \ No newline at end of file +