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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@meisterplayer/plugin-bitmovin

v5.2.2

Published

Meister plugin as a wrapper around Bitmovin

Downloads

5

Readme

Bitmovin plugin for meister

This plugin allows using the Bitmovin player as a media plugin for Meister.

Installation

You can install this plugin through npm:

npm install @meisterplayer/plugin-bitmovin

and importing it

import Meister from 'meisterplayer';
import Bitmovin from '@meisterplayer/plugin-bitmovin'

Getting started

Load the plugin by adding a bitmovin configuration object to the Meister initialisation options. You'll have to provide the license key in the top level config, any other Bitmovin config items you can pass through the bmConfig object.

Example:

var meisterPlayer = new Meister('#player', {
    bitmovin: {
        key: 'YOUR_KEY_HERE'
    }
});

meisterPlayer.setItem({
    src: 'https://example.com/secure/stream/manifest.mpd',
    type: 'mpd',
});

meisterPlayer.load();

Configuration

Options are required unless marked as [optional].

  • key :: string
    Your Bitmovin license key.
  • [optional] analyticsKey :: string
    Your Bitmovin analytics license key.
  • [optional] dvrThreshold :: Number
    Content with a window longer than this threshold is considered as having a DVR window. This is measured in seconds. Defaults to 300 (5 minutes).
  • [optional] bmConfig :: Object
    Through this option it is possible to set default values in the Bitmovin player configuration. This object is directly passed to the Player constructor when instantiating the Bitmovin player. These options can be overridden on a per item basis by setting a bmConfig property on the item. See the docs for information on the configuration object.
    var meisterPlayer = new Meister('#player', {
        bitmovin: {
            key: 'YOUR_KEY_HERE',
            bmConfig: {
                tweaks: {
                    startup_threshold?: 5;
                },
            }
        },
    });

Item options

The following options can be added per item

startFromLive [Boolean] (default: false)

Start from the live edge this will bring the player as close as possible to the live edge.

meisterPlayer.setItem({
    src: 'https://example.com/secure/stream/manifest.mpd',
    startFromLive: true,
    type: 'mpd'
});

startFromBeginning [Boolean|Object] (default: false)

Start from the beginning of the live stream. (VOD streams will always begin from the beginning).

meisterPlayer.setItem({
    src: 'https://example.com/secure/stream/manifest.mpd',
    startFromBeginning: true,
    type: 'mpd'
});

Or you can give an object with an offset to start from a offset

meisterPlayer.setItem({
    src: 'https://example.com/secure/stream/manifest.mpd',
    startFromBeginning: {
        offset: 10, // Start from the "beginning" with an offset of 10 seconds
    },
    type: 'mpd'
});

bmConfig [Object] (default: {})

Through this option it is possible to set override default values in the Bitmovin player configuration on a per item basis. This object is directly passed to the Player constructor when instantiating the Bitmovin player. See the docs for information on the configuration object.

meisterPlayer.setItem({
    src: 'https://example.com/secure/stream/manifest.mpd',
    bmConfig: {
        tweaks: {
            startup_threshold?: 5;
        },
    },
    type: 'mpd'
});

prepareMessage function (default: null)

While using Bitmovin for playback of DRM encrypted content there are extra fields you can add to the Widevine and FairPlay configs of the drmConfig object. The prepareMessage field allow modifications to license request sent from the client. See the Bitmovin Widevine docs or FairPlay docs for more details.

meisterPlayer.setItem({
    src: 'https://example.com/secure/stream/manifest.mpd',
    drmConfig: {
        widevine: {
            prepareMessage: (keyMessage) => {
                return keyMessage.message;
            },
        },
        fairplay: {
            prepareMessage: (event, session) => {
                return event.messageBase64Encoded;
            },
        },
    }
    type: 'mpd'
});

prepareLicense function (default: null)

The prepareLicense field allow modifications to license response before passing it to the CDM. See the Bitmovin Widevine docs or FairPlay docs for more details.

meisterPlayer.setItem({
    src: 'https://example.com/secure/stream/manifest.mpd',
    drmConfig: {
        widevine: {
            prepareLicense: (response) => {
                return new Uint8Array(response.license);
            },
        },
        fairplay: {
            prepareLicense: (response) => {
                return new Uint8Array(response.license);
            },
        },
    }
    type: 'mpd'
});