Bitmovin Player

Setup#

1. Load the plugin script#

For the US zone

<script src="https://cdn.watchingthat.net/us.wtat.plugin-bm_ima.min.js"></script>

For the EU zone

<script src="https://cdn.watchingthat.net/eu.wtat.plugin-bm_ima.min.js"></script>
note

Depending on your contractual agreement with us your data could be hosted in US, Europe or other zone. Make sure you use the correct plugin url otherwise your data will not be routed correctly.

Or you can load the plugin programmatically from the same url.

2. Bitmovin configuration#

In the advertising section of your player config insert the following code

onAdsManagerAvailable: function(IMAAdManager) {
try {
player.wtAdTracer.setAdManager(IMAAdManager);
} catch (e) {
console.error('The Watching That plugin failed to load. Possible causes are ad blockers stopping its load or a CDN failure.', e.message);
}
}

so that your config object now looks similar to this:

const config = {
key: '...',
playback: {
// ...
},
advertising: {
adBreaks: [
// ...
],
onAdsManagerAvailable: function (IMAAdManager) {
try {
player.wtAdTracer.setAdManager(IMAAdManager);
} catch (e) {
console.error('The Watching That plugin failed to load. Possible causes are ad blockers stopping its load or a CDN failure.', e.message);
}
},
},
};

3. Start the plugin#

Start the plugin after instantiating the player but before calling player.load(...):

const player = new bitmovin.player.Player(container, conf);
try {
wtAdTracer({apiKey: '<Watching That API key>'}, player);
} catch (e) {
console.error('The Watching That plugin failed to load. Possible causes are ad blockers stopping its load or a CDN failure.', e.message);
}
player.load(
// ...
).then(
() => {
console.log('Successfully created Bitmovin Player instance');
},
() => {
console.log('Error while creating Bitmovin Player instance');
}
);

See the configuration options for some other config params you can use for the plugin (only apiKey is required).

You can retrieve the API key from the Watching That app.