Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (37 sloc) 1.18 KB
<!doctype html>
<meta charset="utf-8">
<title>Video Frames</title>
<link rel="stylesheet" href="../include/style.css">
#movieclip {
display: none;
Example from <a href=""><em>Foundation HTML5 Animation with JavaScript</em></a>
<canvas id="canvas" width="600" height="360"></canvas>
<aside>Video file may take a moment to load.</aside>
<video id="movieclip" width="640" height="360" autoplay>
<source src="./assets/movieclip.mp4" type="video/mp4"/>
<source src="./assets/movieclip.webm" type="video/webm"/>
<source src="./assets/movieclip.ogv" type="video/ogg"/>
<script src="../include/utils.js"></script>
window.onload = function () {
var canvas = document.getElementById('canvas'),
context = canvas.getContext('2d'),
video = document.getElementById('movieclip');
(function drawFrame () {
window.requestAnimationFrame(drawFrame, canvas);
context.drawImage(video, 0, 0);