wcjs-multiscreen-renderer
v0.2.0
Published
renderer for WebChimera.js, that supported multiscreen rendering
Downloads
5
Maintainers
Readme
Renderer for WebChimera.js
Prerequisites
Install
npm install wcjs-multiscreen-renderer
Usage example
JS:
var wcjs = require("wcjs-multiscreen-renderer");
JavaScript API
setMainContext( vlc, context )
: set main context for render:
context
context object. It has two keys:canvas
- DOM object of desired objectwindow
- Window object of this canvas. It uses to render in different windows
vlc
vlc object, created with webchimera.js`s createPlayer() function
addAdditionalContext( context )
: (optional) add another one context for render:
context
context object. It has three keys:id
- unique id. Just for quick found and check already existed contextcanvas
- DOM object of desired objectwindow
- Window object of this canvas. It uses to render in different windows
init()
: initiate the renderer with all contexts added above.
removeContext( context )
: set main context for render:
context
context object. It has three keys:id
- unique id. Just for quick found and check already existed contextcanvas
- DOM object of desired objectwindow
- Window object of this canvas. It uses to render in different windows
deinit()
: Remove all contexts and execute clearCanvas().
clearCanvas()
: draws a single black frame on the canvas, should be used after stopping the player and/or when the media file has changes (otherwise the frame from the previous video will be kept on the canvas)