Giter VIP home page Giter VIP logo

browsernode's Introduction

CEFnode

Browser node plugin for libavg via CEF

Features

  • Multi-node. Possible to add multiple browser nodes to the libavg scene simultaneously. Ideally, each of those should is linked to a separate Chromium process (as tabs in Chromium are separate processes)
  • Webpage transparency (ie allowing the background of a webpage to be transparent and fully composited within libavg)
  • Video/audio playback subject to the codecs available in CEF. It is possible to control the volume level of audio coming from each browser node individually.(When using HTML5 video/audio tags). When necessary, audio can be muted in config file.
  • JavaScript integration - such that it’s possible to call arbitrary JavaScript code within a hosted page from libavg/python, and such that it’s possible for javascript running within a page to call python methods.
  • Mouse and keyboard input support optionally allowing keyboard or mouse input into the browser node.
  • Disable scroll bars. It is possible to specify that scroll bars are never shown when creating the node.
  • Performant. The browser node is able to render quickly and efficiently on moderate grade hardware (eg Intel compute sticks) even when playing video. It may be necessary to implement partial screen rendering etc to achieve this.
  • Cross-Platform. The resulting plugin works on Windows 32/64 bit and Linux 32/64 bit platforms.

#API

Constructor:

	Mandatory:
	   parent node
	   size
	Optional Parameters:
	   transparent true/false
	   scrollbars true/false
	   mouseInput true/false
	   volume 0.0 - 1.0

Methods:

loadURL( string URL )

sendKeyEvent(avg::KeyEvent event ) - this is necessary because only python can listen to key events.
	
refresh
executeJS(string script)
	
// First string is libavg.send command value to trigger on. supports only 1 callback per command.
addJSCallback( string, callable(string data) ) 

RemoveJSCallback(string command_to_remove)

Properties:

transparent - ro - true/false - Set in constructor.
scrollbars - rw - true/false
audioMute - ro - true/false - Set in avg_cefplugin.ini
mouseInput - rw - true/false
debuggerPort - ro - int - Port for chromium remote developer console. Set in ini.
volume - rw - 0.0 - 1.0 (float)

onFinishedLoading - rw - called when page finished loading.
onCrashed - rw - called when renderer process crashes with reason string.
onCrashedPlugin - rw - called when plugin crashes with plugin path.

Config file

Config file: ./avg_cefplugin.ini - in folder where cefhelper is. It enables adding any command-line argument via ini categories. Everything in [switches] will be added to command line switches if its value is true. And everything in [value_switches] will be added to switches with the specified value. Hyphens('-') Aren't needed before switches. So "mute-audio" and not "--mute-audio". Here is an example describing options:

mute_audio = true/(anything else)
debugger_port = <port> - defaults to 8088

[switches]
<switchname> = true/(anything else)

[value_switches]
<switchname> = <switchvalue>

For proxy configuration or other options refer to: https://www.chromium.org/developers/design-documents/network-settings#TOC-Command-line-options-for-proxy-settings

For debugging use chromium remote debugging console with port specified in config. Then just type localhost: into your regular browser.

browsernode's People

Contributors

akaltar avatar dasgarner avatar alexharrington 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.