I'm using EaselJS to render videos in HTML5 canvases this way:
HTML
<div>
<canvas id="terminal1" width="140" height="82">
<video id="video1" loop="true" width="127" height="70" autoplay="true" src="/url/to/video.mp4">
<source type="video/mp4"/>
</video>
</div>
Javascript
function init() {
stage = new Stage(document.getElementById("cnvs_images"));
var videoTag = document.getElementById('videoTag');
video = new Bitmap(videoTag);
video.visible = true;
terminal1 = new Stage(document.getElementById('terminal1'));
stage.addChild(video);
}
function tick() {
stage.update();
stage_terminal1.update();
}
Don't pay too much attention to the JavaScript code. I've just synthesized to the basics I remember of my real code which is much more larger; it's just a reference to say that I'm rendering the video the EaselJS normal way given in many tutorials; so this snippet may not work but gives the idea. My real code works perfectly!
I just want to know if there's a way to just render a single frame of a video instead of playing it all.
I'm using many canvases for my application and when rendering all the videos needed (6 videos, 6 canvases) if not ultra slow, it slows down a little my app. I wish just to render a pre-visualization of the given video (some seconds of it) or just a single frame. It must be done with EaselJS as I have a lot of functional code done already.