0.2.0 • Published 10 years ago
wcjs-multiscreen-renderer v0.2.0
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:
contextcontext object. It has two keys:canvas- DOM object of desired objectwindow- Window object of this canvas. It uses to render in different windows
vlcvlc object, created with webchimera.js`s createPlayer() function
addAdditionalContext( context ): (optional) add another one context for render:
contextcontext 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:
contextcontext 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)