Skip to content

navy1978/wcjs-renderer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebChimera.js Renderer

Renderer for WebChimera.js

Prerequisites

Install

npm install wcjs-renderer

Usage example

HTML:

<canvas id="canvas"/>

JS:

var renderer = require("wcjs-renderer");
var vlc = require("wcjs-prebuilt").createPlayer();
var options = { /* Add renderer options here */ }
renderer.bind(document.getElementById("canvas"), vlc, options);
vlc.play("http://archive.org/download/CartoonClassics/Krazy_Kat_-_Keeping_Up_With_Krazy.mp4");

JavaScript API

  • bind(vlc, canvas, options): bind the Webchimera VLC player to a canvas element:

    • canvas can be a DOM node or selector (mandatory)
    • vlc is a VLC player created with WebChimera.js (mandatory)
    • options:
      • fallbackRenderer is a boolean mentioning if the fallback non-WebGL renderer should be used (optional, defaults to false),
      • preserveDrawingBuffer is a boolean mentioning if we should preserve the drawing buffer (optional, defaults to false),
      • onFrameSetup will be called when VLC's onFrameSetup callback is called, with the same arguments, after the canvas has been setup.
      • onFrameReady will be called when VLC's onFrameReady callback is called, with the same arguments, after the frame has been rendered to the canvas.
      • onFrameCleanup will be called when VLC's onFrameCleanup callback is called, with the same arguments, after the frame was cleaned up.
  • clear(canvas): draws a single black frame on a canvas element

About

Renderer JS API for WebChimera.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%