npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vbrick/rev-sdk

v1.1.0

Published

Client SDK for Vbrick Rev

Downloads

949

Readme

Rev JavaScript SDK

This is Vbrick's JavaScript SDK library that enables you to embed Vbrick Rev webcasts and videos (also known as Video on Demand or VOD) on your website, portal, or any web-based application using JavaScript code. The SDK supports interaction with the webcast, video and playlist embedded players.

Demo Page

Auto-Generated Documentation

Accessing the SDK

The JavaScript SDK can be accessed via <script> tag in your HTML. Set the src attribute to https://cdn.jsdelivr.net/npm/@vbrick/rev-sdk@latest/dist/rev-sdk.js or import for ES6 module.

<script src="https://cdn.jsdelivr.net/npm/@vbrick/rev-sdk@latest/dist/rev-sdk.js"></script>

<script type="module">
  import revSdk from "https://cdn.jsdelivr.net/npm/@vbrick/rev-sdk@latest/dist/rev-sdk.esm.js";
</script>

Install using npm

If you use npm, then you can run

npm install @vbrick/rev-sdk

Building The SDK Locally

npm install
npm run build

Embedding a Webcast

On your web page, you can insert an embedded webcast using an empty div tag. You will have to reference the div id when you interact with the SDK.

<div id="embed"></div>

Invoking Webcast

Embedding a webcast requires you to pass the following parameters to the embedWebast function

  • Either a CSS selector string or HTML div element where the embed content will be rendered
  • Rev Webcast Id
  • Webcast Config which consists of the following individual parameters
    • token (type=object, Required): Token for the user who is watching the webcast, which can be unique for each embed
      • type (type=string, Required): Set to 'JWT' for JSON Web Token, 'AccessToken' for an OAuth or API token, or 'GuestRegistration' for a token generated using the Guest Registration APIs.
      • value (type=string, Required): Value of the token
      • issuer (type=string): Issuer of the token.
    • baseUrl (type=string, Required): Your Rev URL
    • className (type=string, Optional): CSS classes if you want to include to the embed iFrame
    • width (type=string, Optional): iframe width if you want to overwrite the default responsive behavior
    • height (type=string, Optional): iframe height if you want to overwrite the default responsive behavior
    • showVideo (type=boolean, Optional, Default:true): to control display of video player or not. It's more useful for future release once we add Webcast Q&A, Polls, Chat features to the SDK.
    • log (type=boolean, Optional, Default:false): If set to true, you can get additional browser console log. You may need additional logging during your development and troubleshooting
const webcastId = '<<WEBCAST_ID>>';
const jwtToken = {
    type: 'JWT',
    issuer: '<<ISSUER>>',
    value: '<<JWT_TOKEN>>'
};
const webcast = revSdk.embedWebcast('#embed', webcastId, {
    baseUrl: 'https://<<YOUR_REV_URL>>',
    token: jwtToken,
    log: true
});

Listening to Webcast Events

You can listen for events in the webcast by adding a callback using .on(). See example below

webcast.on('broadcastStarted', function() {
  // handle this event
});

Supported Webcast Events

  • broadcastStarted
  • broadcastStopped
  • webcastStarted
  • webcastEnded
  • error
Stop Listening to Events

You can stop listening for the events using .off(). See example below

webcast.off('broadcastStarted', handlerFunction);
Get Webcast Status

You can get the status of the webcast using status variable. See example below

const webcastStatus = webcast.webcastStatus;

Webcast Status Values

  • Broadcasting
  • Completed
  • Error
  • InProgress
  • Loading
  • Scheduled
Removing Webcast

You can remove the webcast from the DOM by calling destroy method.

webcast.destroy();

Embedding a Video

You can embed a video just like a webcast using an empty div tag.

<div id="embed"></div>

Use the embedVideo method to display the video on your web page:

const videoId = '01234567-89AB-CDEF-0123-456789ABCDEF';
const token = {
    type: 'AccessToken',
    issuer: 'vbrick',
    value: '<<Token Value>>'
};

const vbrickEmbed = revSdk.embedVideo('#embed', videoId, {
	log: true,
	token,
  baseUrl: 'https://<<YOUR_REV_URL>>',
});

Use the .on method to watch for events about the video:

const onVideoLoaded = data => console.log(`Video loaded: ${JSON.stringify(data)}`);

vbrickEmbed.on('videoLoaded', onVideoLoaded);

Use the .off method to stop listening for events:

vbrickEmbed.off('videoLoaded', onVideoLoaded);
Control the player using external commands:
vbrickEmbed.play();
vbrickEmbed.pause();
vbrickEmbed.setVolume(0.5);
Supported Video Events
  • videoLoaded
  • playerStatusChanged
    • Buffering
    • Ended
    • Initializing
    • Paused
    • Playing
    • Seeking
  • volumeChanged
  • seeked
  • error
Video Config Example
{
  "accentColor": "ff0000",
  "autoplay" : true,
  "forcedCaptions": false,
  "hideCaptions": false,
  "hideChapters" : false,
  "hideFullscreen": false,
  "playInLoop": true,
  "hideOverlayControls": false,
  "hidePlayControls": false,
  "hideSettings": false,
  "popOut": false,
  "startAt": "00m10s"
}
Get Video Status

You can get the status of the video using status variable, this reflects the latest playerStatusChanged event. See example below

vbrickEmbed.playerStatus;

Removing Webcast

You can remove the webcast from the DOM by calling destroy method.

Removing Video

You can remove the video from the DOM by calling destroy method.

vbrickEmbed.destroy();