Funciona en Chrome y Firefox pero no en IE. Tengo la version 11
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 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"' />
<canvas id="myCanvas" width="270" height="135" style="border:1px solid #d3d3d3;"></canvas> <canvas id="myCanvas" width="270" height="135" style="border:1px solid #d3d3d3;"></canvas>
Código Javascript
:
Ver originalvar 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);