Game Development Reference
In-Depth Information
The element has been paused. Fired after the
pause()
meth-
od has returned.
pause
Either the default
Playback Rate
or the
playback Rate
attribute has just been updated.
ratechange
Either the
volume
attribute or the
muted
attribute has
changed. Fired after the relevant attribute's setter has re-
turned.
volumechange
Note
For more information on events, visit W3C Candidate Recommendation Media
One final reason that you should be excited about the new HTML5 video element is
that each frame of the video can be rendered right into a canvas 2D rendering con-
text, just as if a single frame was a standalone image. This way, we are able to do
video processing right on the browser. Unfortunately, there is no
video.toDataURL
equivalent where we could export the video created by our JavaScript application.
var ctx = null;
var ctxOff = null;
var poster = new Image();
poster.src = "bunny-poster.jpg";
poster.addEventListener("click", initVideo);
document.body.appendChild(poster);
// Step 1: When the video plays, call our
custom drawing function