Git Product home page Git Product logo

wcjs-renderer's Introduction

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(canvas, vlc 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 (it's recommended to clear the canvas when the Media Changed and Ended events are triggered)

  • getFps(function): returns int in callback, the number of frames that wore rendered in 1 seconds after the request was made (useful for performance tests and getting the current fps of a live stream as it normally returns as 0 with the WebChimera.js native method, to note: even when playback is paused it still renders at 10 fps)

wcjs-renderer's People

Contributors

rsatom avatar jaruba avatar guidupuy avatar luigiplr avatar navy1978 avatar ivshti avatar ruurdbijlsma avatar alexbinary avatar shenanigans avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.