Código HTML:
Ver original
<video id="video1" controls width="270" > <source src="videos/Chrome_ImF.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <source src="videos/Chrome_ImF.ogv" type='video/ogg; codecs="theora, vorbis"' /> </video> <video id="video1" controls width="270" > <source src="videos/mov_bbb.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <source src="videos/mov_bbb.ogv" type='video/ogg; codecs="theora, vorbis"' /> </video>
Código Javascript:
Ver original
var canvas=document.getElementsByTagName("canvas"); var v=document.getElementsByTagName("video"); var ctx; document.getElementById("video1").addEventListener('loadeddata', function(){ for (var i=0;i<v.length;i++){ ctx=canvas[i].getContext('2d'); ctx.drawImage(v[i],5,5,260,125); } },false);