Page tree
Skip to end of metadata
Go to start of metadata
This feature is supported starting with version 0.8.869

DrawImage only supports image, canvas, or video as image sources. 
Because the plugin replaces <video> elements with <object> elements, drawImage is not capable of interacting with it.

To solve this issue, we display the API plugin.getFrame which returns a base64 encoded bitmap (header + buffer) of the last played frame.

How do I use it ?

See the following example:

Use drawImage with the plugin
var canvas = ... // your canvas in the DOM
var video  = ... // your plugin rendering <object>
var base64 = video.getFrame();
var image  = new Image();
image.onload = function () {
  drawImage(image, 0, 0, canvas.width, canvas.height);
image.setAttribute('src', 'data:image/bmp;base64,' + base64);

Live example

See a few live examples here :

  • No labels