Coder Social home page Coder Social 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

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wcjs-renderer's Issues

VLC http streaming params not working

I've tried to stream the output to http, so I it can be possible to play it as

var vlc = require("wcjs-prebuilt"); var renderer = require("wcjs-renderer"); var player = renderer.init("canvas", [":sound=#transcode{vcodec=theo,venc=theora,scale=1,acodec=vorb,ab=160,channels=2,samplerate=44100}:http{mux=ogg,dst=:8081/test}"], { }, vlc);

Scale Video

Is it possible to scale the video output to canvas size?
I think that this could be done in the onFrameReady callback, but i am not sure.

subtitles

Maybe I'm just stupid but I can't get subtitles to display. I've been doing this sort of thing...

var vlc = wcjs_renderer.init (canvasElem);
vlc.play (localFilePath);
vlc.events.once ('FrameReady', function (frame) {
    vlc.subtitles.track = 1;
});

I've tried placing a div.wcp-subtitles in the page like the normal player app would want, no luck. My reading leads me to believe that in -renderer the subtitles are supposed to be rendered by VLC and appear in the normal frame data, is this correct? Is there a doc page I missed somewhere? The "Javascript API" I keep seeing doesn't seem to describe webchimera.js at all, specifying lots of methods that aren't there. Is my problem between my keyboard and chair?

This has all been with an x64 build from wcjs-prebuilt.

Provide a renderer for WebGL 2.0

Currently, chromium has experimental support for WebGL 2.0. Personally, I couldn't get it to work, but making a note here that once I do, I should get support for WebGl 2.0 implemented in wcjs-renderer.
It provides PBOs and the RED texture types, which will fix our texture upload issues.

Trying to run wcjs-renderer without wcjs-prebuilt results in binding error

Currently when trying to run the renderer standalone after building, I encounter this error on load:

/Users/matt/wcjs-test/electron-quick-start/node_modules/wcjs-renderer/node_modules/webchimera.js/node_modules/bindings/bindings.js:86
Uncaught Error: Module version mismatch. Expected 47, got 43.

I can get the renderer to work when using the wcjs-prebuilt, however I am encountering a separate issue there when attempting to run after browserifying.

Any insights into what this is about or how to fix?

use wcjs-prebuilt?

I made a branch that uses wcjs-prebuilt, should we merge this to master?

It can also be used alternatively by linking to the prebuilt branch instead of the master branch from package.json.

@Ivshti is this the correct way of implementing wcjs-prebuilt?

@RSATom can you think of any reason why it shouldn't be merged?

@luigiplr are you eating pizza right now?

Debug information?

Hi,

Is there anyway to get debug information for what's happening with the player behind the scenes?. I am using the renderer with wcjs-prebuilt and pointing it at a HLS playlist but it just fails to play. There's no information available and requests don't even show up in chrome dev tools for some reason.

Is there anyway to gain some insight into what the player is failing on with this playlist?

Video stops playing

Hello, with the example provided, the video stop's playing after some time. With wcjs-player, this doesn't happen

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.