Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Commit

Permalink
synced video to playback rate rather than timeupdate event
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Apr 25, 2011
1 parent 0ccf761 commit 3784b06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions video-canvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
}
});

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";
Expand Down Expand Up @@ -92,4 +92,4 @@
}
</script>
</body>
</html>
</html>

1 comment on commit 3784b06

@yiqiejieyoukeneng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<style> #div1 {width:350px;height:70px;padding:10px;border:1px solid #aaaaaa;} </style> <script> function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); ev.target.appendChild(document.getElementById(data)); } </script>

Drag the W3Schools image into the rectangle:


Please sign in to comment.