All Projects → twilio → twilio-video-room-monitor.js

twilio / twilio-video-room-monitor.js

Licence: Apache-2.0 license
A browser-based tool that displays information and metrics about Twilio Video JavaScript applications

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to twilio-video-room-monitor.js

useful-twilio-functions
A set of useful Twilio Functions.
Stars: ✭ 53 (+140.91%)
Mutual labels:  twilio
IEvangelist.VideoChat
Imagine two Twilio SDKs, ASP.NET Core/C#, Angular/TypeScript, SignalR, etc... Yeah, amazing!
Stars: ✭ 66 (+200%)
Mutual labels:  twilio
ruby-whatsapp-bots
A repo of WhatsApp bots built in Ruby
Stars: ✭ 18 (-18.18%)
Mutual labels:  twilio
jpetstore-kubernetes
Modernize and Extend: JPetStore on IBM Cloud Kubernetes Service
Stars: ✭ 21 (-4.55%)
Mutual labels:  twilio
poseparty
A social exercise game you can play while social distancing.
Stars: ✭ 25 (+13.64%)
Mutual labels:  twilio
trampoline
A complete dapp development framework for Nervos Network
Stars: ✭ 27 (+22.73%)
Mutual labels:  devtool
flutter ume
UME is an in-app debug kits platform for Flutter. Produced by Flutter Infra team of ByteDance
Stars: ✭ 1,792 (+8045.45%)
Mutual labels:  devtool
terraform-provider-twilio
Terraform provider for Twilio. 🌎☎️ Preserved for archaeological fun. Please see the official Twilio TF provider @ https://github.com/twilio/terraform-provider-twilio.
Stars: ✭ 32 (+45.45%)
Mutual labels:  twilio
sketchup-ruby-debugger
Ruby API debugger for SketchUp 2014 and later.
Stars: ✭ 62 (+181.82%)
Mutual labels:  devtool
twilio-taskrouter.js
JS SDK v2 for Twilio's TaskRouter skills based routing system.
Stars: ✭ 20 (-9.09%)
Mutual labels:  twilio
hackathons
A collection of tips and tricks for using Twilio at hackathons
Stars: ✭ 35 (+59.09%)
Mutual labels:  twilio
microblog-authy
Microblog application from the Flask Mega-Tutorial with added two-factor push authentication via Authy
Stars: ✭ 26 (+18.18%)
Mutual labels:  twilio
sms-bot
an SMS bot built with Google sheets and Twilio
Stars: ✭ 61 (+177.27%)
Mutual labels:  twilio
appointment-reminders-rails
A working Appointment Reminders sample built in Ruby on Rails
Stars: ✭ 36 (+63.64%)
Mutual labels:  twilio
twilio-chat-demo-android
Chat API Demo Application for Android
Stars: ✭ 64 (+190.91%)
Mutual labels:  twilio
wireless-fleet-tracker
Create a Twilio-powered Fleet Tracker that uses off-the-shelf components to track and log: miles driven, hours of uptime and downtime, locations, average speed, and fuel consumption.
Stars: ✭ 21 (-4.55%)
Mutual labels:  twilio
HotelManagement
🏡 A Hotel Management system in C#
Stars: ✭ 77 (+250%)
Mutual labels:  twilio
twilio-go
Twilio Go library
Stars: ✭ 136 (+518.18%)
Mutual labels:  twilio
personal-wealth-portfolio-mgt-bot
WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. This repository will be kept available in read-only mode.
Stars: ✭ 43 (+95.45%)
Mutual labels:  twilio
wireless-portable-fax
Build a cellular connected portable fax machine
Stars: ✭ 17 (-22.73%)
Mutual labels:  twilio

Twilio Video Room Monitor

CircleCI

We want your feedback! Please feel free to open a GitHub issue for suggested improvements or feature requests.

What is it

A browser-based tool that provides Twilio Video JavaScript developers visibility into the inner workings of their video application. It displays near real-time information and metrics from the Room object and can be added to any Twilio Video JavaScript application with a few lines of code.

Room Monitor gif

The Twilio Video Room Monitor can be used as a tool during all phases of development or can be forked, customized, and provided to end-users as an in-call troubleshooting view.

To learn more, visit the Video Room Monitor Documentation.

Changelog

View Changelog.md for details about our releases.

Browser Support

Chrome Edge (Chromium) Firefox Safari
Android - -
iOS - -
Linux - -
macOS
Windows -

Getting Started

NPM

You can install directly from npm.

npm install @twilio/video-room-monitor --save

Using this method, you can import @twilio/video-room-monitor and open the monitor like so:

import Video from 'twilio-video';
import { VideoRoomMonitor } from '@twilio/video-room-monitor';

Video.connect('token').then((room) => {
  VideoRoomMonitor.registerVideoRoom(room);
  VideoRoomMonitor.openMonitor();
});

Script Tag

You can also copy twilio-video-room-monitor.min.js from the dist/browser folder and include it directly in your web app using a <script> tag.

<script src="https://my-server-path/twilio-video-room-monitor.min.js"></script>

Using this method, you can register a room and open the room monitor like so:

window.Twilio.VideoRoomMonitor.registerVideoRoom(room);
window.Twilio.VideoRoomMonitor.openMonitor();

Console Script Quickstart (not for production use)

As a way to quickly use the Video Room Monitor in any Twilio Video JavaScript application, you can also run the following snippet in the browser console to open the Monitor:

(() => {
  const script = document.createElement('script');
  script.src = 'https://cdn.jsdelivr.net/npm/@twilio/video-room-monitor/dist/browser/twilio-video-room-monitor.min.js';
  script.onload = () => {
    // Register your Twilio Video Room here
    window.Twilio.VideoRoomMonitor.registerVideoRoom(twilioRoom);
    window.Twilio.VideoRoomMonitor.openMonitor();
  };
  document.body.appendChild(script);
})();

Note that the Room object must be exposed as a global variable (twilioRoom as seen in the above example) so that it can be registered with the Monitor.

Using this method, you can then close or toggle the monitor like so:

Twilio.VideoRoomMonitor.closeMonitor();
Twilio.VideoRoomMonitor.toggleMonitor();

NOTE: This method is not recommended for production use due to the CDN, as we don't have control of the availability of cdn.jsdelivr.net.

Usage

registerVideoRoom()

This is a required step to be able to use the Video Room Monitor. This registers a Twilio Video Room. To register a room, you can run the following line of code:

VideoRoomMonitor.registerVideoRoom(newRoom);

openMonitor()

This opens the monitor and emits the opened event. To open the monitor, you can run this line of code in the console:

VideoRoomMonitor.openMonitor();

To listen for the opened event, you can run the following line of code:

VideoRoomMonitor.on('opened', () => console.log('the monitor has been opened'));

closeMonitor()

This closes the monitor and emits the closed event. To close the monitor, you can run this line of code in the console:

VideoRoomMonitor.closeMonitor();

To listen for the closed event, you can run the following line of code:

VideoRoomMonitor.on('closed', () => console.log('the monitor has been closed'));

toggleMonitor()

This toggles the monitor to be either open or closed. If the monitor is currently closed, then it will open the monitor (and emit the opened event) and vice versa. To toggle the monitor, you can run this line of code in the console:

VideoRoomMonitor.toggleMonitor();

isOpen

This is a boolean value that indicates whether or not the monitor is currently open.

VideoRoomMonitor.isOpen;

Local Development

Prerequisites

You must have the following installed:

  • Node.js v14+
  • NPM v7+ (comes installed with newer Node versions)

Install dependencies

Fork and clone the repository, then install all dependencies with

npm install

Scripts

npm start

Compile the app (in watch mode) into a directory (dist/node) that will allow users to install the Monitor locally with NPM.

npm install -S <path_to_monitor>

NPM will install the Monitor as a symlink, so as files are edited, saved, and re-compiled, they will automatically be reflected in the application that has installed the Monitor locally.

Any TypeScript errors that are found will be displayed in the console.

npm run build

This will build both Node.js and browser versions of the Monitor in the dist/ directory.

npm run ts

Run this command to check the types in the app.

npm test

Runs all unit tests.

npm run lint

Runs the linter.

npm run parcel:watch

This will host the app on a local server. This server can then be used to run the tool in the browser by using a script tag:

<script src="http://localhost:1234/twilio-video-room-monitor.js></script>

Or by running this code snippet in the console of your browser:

(() => {
  const script = document.createElement('script');
  script.src = 'http://localhost:1234/twilio-video-room-monitor.js';
  script.onload = () => {
    // Register your Twilio Video Room here
    window.Twilio.VideoRoomMonitor.registerVideoRoom(twilioRoom);
    window.Twilio.VideoRoomMonitor.openMonitor();
  };
  document.body.appendChild(script);
})();

After this has finished running, you can run commands to open and close the monitor within the console.

License

See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].