Giter Site home page Giter Site logo

ericssonbroadcastservices / javascript-player-mux-data Goto Github PK

View Code? Open in Web Editor NEW
0.0 8.0 0.0 59 KB

Red Bee Media JavaScript Player Mux Data module

Home Page: https://redbee.live/docs/Client%20SDKs/Web/Player/Documentation/

License: MIT License

TypeScript 100.00%
mux video-analytics

javascript-player-mux-data's Introduction

RedBeeMedia JavaScript Player Mux Data

version REUSE status

RedBee JavaScript Player plugin for sending analytics data to Mux. The plugin is provided as is and is not actively maintained.

Usage

import { RedBeePlayer } from "@redbeemedia/javascript-player";
import { MuxData } from "@redbeemedia/javascript-player-mux-data";

// 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 and
  https://docs.mux.com/guides/data/extend-data-with-custom-metadata#4-submitting-custom-metadata-from-mux-data-sdks for more information.
*/
const analytics = new MuxData({
  debug: true,
  muxDataMetadata: {
    env_key: "your-mux-env-key",
    // Other custom metadata fields
  },
  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();

Default fields that will be set on initialization:

{
  "env_key": "<mux-env-key>",
  "player_software_name": "<player-software-name>",
  "player_software_version": "<player-software-version>",
  "player_name": "<player-name>",
  "player_version": "<player-version>",
  "player_mux_plugin_name": "<mux-plugin-name>",
  "player_mux_plugin_version": "<mux-plugin-version>",
  "player_init_time": "<player-init-time>",
  "view_session_id": "<view-session-id>",
  "viewer_os_family": "<viewer-os-family>",
  "viewer_os_version": "<viewer-os-version>",
  "viewer_os_architecture": "<viewer-os-architecture>",
  "viewer_device_name": "<viewer-device-name>",
  "viewer_device_category": "<viewer-device-category>",
  "viewer_device_manufacturer": "<viewer-device-manufacturer>",
  "video_id": "<video-id>",
  "video_stream_type": "<live/on-demand>",
  "video_cdn": "<video-cdn>",
  "video_duration": "<video-duration>",
  "video_title": "<video-title>"
}

javascript-player-mux-data's People

Contributors

oscnord avatar friday avatar olivbraun avatar

Watchers

Alessandro dos Santos Pinto avatar Johan Spaedtke avatar Mohammed El Shobaki avatar Leonard Norberg avatar Gabriel Vilén avatar Jenkins avatar Johan Svedberg avatar Razvan Mielcioiu 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.