[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Thu Sep 13 2018

Web-Collector v1.7 API change: Embedded analytics configuration for Bitmovin Player

With version v1.7 of the Bitmovin Analytics collector we rolled out a new configuration API meant to streamline the setup process for customers using the Bitmovin Player as well as Bitmovin Analytics.

In a nutshell: Everything you supplied to bitmovin.analytics({}) before has now moved to the analytics property inside the Bitmovin Player configuration.

Old API:

1var bitanalyticsConfig = {
2 key: "INSERT-ANALYTICS-KEY-HERE"
3};
4var analytics = bitmovin.analytics(bitanalyticsConfig);
5
6var player = bitmovin.player("player");
7var playerConfig = {}; // Set up your Bitmovin Player Configuration
8
9// Instrument the Player with Analytics
10analytics.register(player);
11player.setup(playerConfig);

New API:

1var player = bitmovin.player("player");
2bitmovin.analytics.augment(player); // This adds analytics to the player
3player.setup({
4 // Set up your Bitmovin Player normally with source attributes etc..
5
6 // Add the analytics configuration here
7 analytics: {
8 key: "INSERT-ANALYTICS-KEY-HERE",
9 videoId: 'CMS video ID',
10 title: 'Human readable video title'
11 };
12});

This also enables us to more reliably track changes to the currently playing video without having to introduce another API for signaling these types of metadata changes to the collector.

The Analytics collector now also looks for source changes via the player.load method so to change the video and the associated metadata with it:

1player.load({
2 hls: 'path/to/new/stream.m3u8',
3 analytics: {
4 title: 'New Video Name',
5 videoId: 'CMS video ID'
6 }
7});

Note: When calling player.load you don't need to specify any properties that were already specified in the setup call - the new values just override the old ones.

Give us feedback