Overriding bundled Bitmovin Player v8 Analytics collector

If you are running a pre-bundled release of Bitmovin Player v8 it already includes Bitmovin Analytics out of the box.

This article explains how to override the bundled version of the Bitmovin Analytics collector. This is useful if you want to update the collector version but don't want to update your player.

Usage with html script tag

Include a specific version of Bitmovin Analytics with the script tag in your html file

<script type="text/javascript" src="https://cdn.bitmovin.com/analytics/web/2.15.2/bitmovinanalytics.min.js"></script>

Register the analytics module before instantiating the player. This overrides the bundled Bitmovin Analytics collector.

bitmovin.player.Player.addModule(bitmovin.analytics.PlayerModule);
var player = new bitmovin.player.Player(container, configWithAnalytics);

Usage with NPM distributions

When embedding the Bitmovin Player via NPM distributions, it requires manual loading of the module

import {Player} from 'bitmovin-player/modules/bitmovinplayer-core';
import {PlayerModule as AnalyticsModule} from 'bitmovin-analytics';

Player.addModule(AnalyticsModule);
var player = new Player(container, configWithAnalytics);