[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

Wed Jun 10 2020

How can I access the IMA-SDK of HTML5 player

In Version 8 (exactly since 8.14.0) of the Bitmovin web-player-sdk
you can directly access the default Advertings Module which is the IMA-SDK from Google.

How would you do this?

Our Player offers two callbacks for that:

Callback that provides access to the google.ima.ImaSdkSettings before any initialization happens.


Callback that provides access to the ad container HTML-Element.


this callback passes the google.ima.AdsManager as you will see in the next example.


Example:

1const playerConfig = {
2 key: '<KEY>',
3 advertising: {
4 adBreaks: [
5 {
6 tag: {
7 url:'<VAR-URL>',
8 type: 'vast',
9 },
10 id: 'Ad',
11 position: 'pre'
12 }
13 ],
14 onAdsManagerAvailable : (IMAAdManager) => {
15 // example of IMA AdManager usage
16 IMAAdManager.addEventListener( google.ima.AdEvent.Type.AD_PROGRESS, (IMAEvent) => {
17 var adProgressData= IMAEvent.getAdData();
18 console.log(parseInt(adProgressData.duration)-parseInt(adProgressData.currentTime));
19 });
20 }
21 }
22};



Link to the release: https://bitmovin.com/docs/player/releases/web/web-8-14-0

Give us feedback