Giter VIP home page Giter VIP logo

jitsi-meet-electron-utils's Introduction

jitsi-meet-electron-utils

Utilities for jitsi-meet-electron project.

Installation

jitsi-meet-electron-utils contains native code for some utilities. You'll need node-gyp to build it and also you'll need to rebuild the package for Electron. For more information see Using Native Node Modules and electron-rebuild.

NOTE: For Linux install libxtst-dev and libpng++-dev (sudo apt-get install libxtst-dev libpng++-dev). This dependancies are related to RobotJS which is a dependency of jitsi-meet-electron-utils. You can see the build instructions for RobotJS here

Usage

Remote Control

Requirements: The remote control utility requires iframe HTML Element that will load Jitsi Meet.

Enable the remote control:

const {
    RemoteControl
} = require("jitsi-meet-electron-utils");

// iframe - the Jitsi Meet iframe
const remoteControl = new RemoteControl(iframe);

To disable the remote control:

remoteControl.dispose();

NOTE: dispose method will be called automatically when the Jitsi Meet iframe unload.

Screen Sharing

Requirements: The screen sharing utility requires iframe HTML Element that will load Jitsi Meet.

Enable the screen sharing:

In the render electron process of the window where Jitsi Meet is displayed:

const {
    setupScreenSharingRender
} = require("jitsi-meet-electron-utils");

// api - The Jitsi Meet iframe api object.
setupScreenSharingRender(api);

In the main electron process:

const {
    setupScreenSharingMain
} = require("jitsi-meet-electron-utils");

// jitsiMeetWindow - The BrowserWindow instance of the window where Jitsi Meet is loaded.
// appName - Application name which will be displayed inside the content sharing tracking window
// i.e. [appName] is sharing your screen.
// osxBundleId - Mac Application bundleId for which screen capturer permissions will be reset if user denied them.  
setupScreenSharingMain(mainWindow, appName, osxBundleId);

Always On Top

Displays a small window with the current active speaker video when the main Jitsi Meet window is not focused.

Requirements:

  1. Jitsi Meet should be initialized through our iframe API
  2. The BrowserWindow instance where Jitsi Meet is displayed should use the Chrome's window.open implementation (set nativeWindowOpen option of BrowserWindow's constructor to true).
  3. If you have a custom handler for opening windows you have to filter the always on top window. You can do this by its frameName argument which will be set to AlwaysOnTop.
  4. Electron version >=1.7.x.

Enable the aways on top:

In the main electron process:

const {
    setupAlwaysOnTopMain
} = require("jitsi-meet-electron-utils");

// jitsiMeetWindow - The BrowserWindow instance
// of the window where Jitsi Meet is loaded.
setupAlwaysOnTopMain(jitsiMeetWindow);

In the render electron process of the window where Jitsi Meet is displayed:

const {
    setupAlwaysOnTopRender
} = require("jitsi-meet-electron-utils");

const api = new JitsiMeetExternalAPI(...);
const alwaysOnTop = setupAlwaysOnTopRender(api);

alwaysOnTop.on('will-close', handleAlwaysOnTopClose);

setupAlwaysOnTopRender return an instance of EventEmitter with the following events:

  • dismissed - emitted when the always on top window is explicitly dismissed via its close button

  • will-close - emitted right before the always on top window is going to close

WiFi Stats

Provides a function to query for wifi stats on the host computer. Returns information like interface name, addresses, signal quality, noise (not available on all OS).

WiFi Stats:

In the render electron process of the window where Jitsi Meet is displayed:

const {
    setupWiFiStats
} = require("jitsi-meet-electron-utils");

const api = new JitsiMeetExternalAPI(...);
setupWiFiStats(api.getIFrame());

Power Monitor

Provides a way to query electron for system idle and receive power monitor events.

enable power monitor: In the main electron process:

const {
    setupPowerMonitorMain
} = require("jitsi-meet-electron-utils");

// jitsiMeetWindow - The BrowserWindow instance
// of the window where Jitsi Meet is loaded.
setupPowerMonitorMain(jitsiMeetWindow);

In the render electron process of the window where Jitsi Meet is displayed:

const {
    setupPowerMonitorRender
} = require("jitsi-meet-electron-utils");

const api = new JitsiMeetExternalAPI(...);
setupPowerMonitorRender(api);

NOTE:

If you are using electron 5 you'll need to add 'disable-site-isolation-trials' switch because of electron/electron#18214:

app.commandLine.appendSwitch('disable-site-isolation-trials')

Example

For examples of installation and usage checkout the Jitsi Meet Electron project.

jitsi-meet-electron-utils's People

Contributors

akshitkrnagpal avatar andrei-gavrilescu avatar andreieftimie avatar bgrozev avatar damencho avatar dependabot[bot] avatar dtrierweiler avatar egm0121 avatar gimre avatar horymury avatar hristoterezov avatar marshallofsound avatar quitrk avatar saghul avatar virtuacoplenny avatar yanas 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.