Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@redbeemedia/javascript-player-plugins

Package Overview
Dependencies
Maintainers
4
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redbeemedia/javascript-player-plugins

Plugins Javascript Module

  • 0.55.1
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
4
Weekly downloads
 
Created
Source

RedBeeMedia JavaScript Player Plugins

Plugins for the JavaScript player.

Available plugins

Mux Data Plugin

Plugin for sending analytics data to Mux.

Usage
import { RedBeePlayer } from "@redbeemedia/javascript-player";
import { MuxDataPlugin } from "@redbeemedia/js-player-plugins";

// Setup and load the player as usual
const player = new RedBeePlayer(...);

/*
  Create a new instance of the plugin
  The muxDataMetadata property can contain custom metadata fields to be sent to Mux. 
  See https://docs.mux.com/guides/data/make-your-data-actionable-with-metadata for more information.
*/
const analytics = new MuxDataPlugin({
  debug: true,
  muxDataMetadata: {
    env_key: "your-mux-env-key",
  },
  privacySettings: {
    respectDoNotTrack: false,
    disableCookies: false,
  },
  locale: "" // optional locale for which the plugin will try to select a video title
});

// Add the plugin to the player
// The plugin will be initialized and start sending data to Mux as soon as the player is ready
analytics.connect(player);

// To disconnect the plugin
analytics.disconnect();

// To destroy the plugin
analytics.destroy();

Implement your own plugin

Plugins should always extend the AbstractPlugin class that defines the interface for player plugins. The AbstractPlugin class also provides some helper methods for plugins to use.

import { AbstractPlugin, IBasePluginOptions } from "./AbstractPlugin";
import type { RedBeePlayer } from "@redbeemedia/javascript-player";

export class MyCustomPlugin extends AbstractPlugin {
  constructor(options: IBasePluginOptions) {
    // Call the super constructor with the plugin debug flag.
    super(options.debug);
    // Do your plugin initialization here.
  }

  public connect(playerInstance: RedBeePlayer): void {
    // This method will be called when the plugin is loaded.
    // The plugin should connect to the player and listen for player events.
  }

  public disconnect(): void {
    // This method will be called when the plugin is unloaded.
    // The plugin should stop listening for player events.
  }

  public destroy(): void {
    // This method will be called when the plugin is destroyed.
    // The plugin should clean up any resources it has created.
  }
}

FAQs

Package last updated on 28 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc