Bitmovin Analytics Collector Plugin for THEOPlayer
Instruments THEOPlayer and collects information to be sent to the Bitmovin Analytics service.
To get started collecting data with Bitmovin Analytics you need a License-Key which you can get for free by signing up for a free Bitmovin account.
Installation
Using npm
npm install @qualabs/bitmovin-analytics-collector-theoplayer
Using a CDN
<script src="https://cdn.jsdelivr.net/npm/@qualabs/bitmovin-analytics-collector-theoplayer@latest/dist/bitmovin-analytics-collector-theoplayer.min.js"></script>
Usage
Before integrating the plugin, make sure you have a working installation of THEOPlayer. For more details on installing and using THEOPlayer, please refer to the THEOPlayer Getting Started Guide.
Using the Plugin via Module Import
If you are using a module bundler, import the plugin as follows:
import { TheoCollector } from "theo-bitmovin-collector-plugin";
const analyticsConfig = {
licenseKey: 'your_bitmovin_analytics_license',
};
collector = new TheoCollector(analyticsConfig, player);
Using the Plugin via Script Tag
Alternatively, if you prefer using a script tag, include the plugin from the CDN and initialize it:
<script src="https://cdn.jsdelivr.net/npm/@qualabs/bitmovin-analytics-collector-theoplayer@latest/dist/bitmovin-analytics-collector-theoplayer.min.js"></script>
<script>
const analyticsConfig = {
licenseKey: 'your_bitmovin_analytics_license',
};
var collector = new bitmovin.TheoCollector(analyticsConfig, player);
</script>
Note: The collector plugin supports both the standard and chromeless versions of THEOPlayer.
Full Analytics Config
Below is an example of the complete configuration object for Bitmovin Analytics:
const fullConfig = {
licenseKey: string,
randomizeUserId: boolean,
backendUrl: string,
cdnProvider: string,
customUserId: string,
sourceMetadata: {
title: string,
videoId: string,
cdnProvider: string,
path: string,
isLive: boolean,
},
cookiesEnabled: boolean,
cookiesDomain: string,
cookiesMaxAge: number,
customData1: string,
customData50: string,
}