Bitmovin Player
Setup
1. Load the plugin script
The plugin url is in the form
<script src="https://cdn.watchingthat.net/***.wtat.plugin-bm_ima.min.js"></script>
You must replace ***
with the Watching That customer ID received from us.
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.