Interactive Media Ads (IMA)
IMA SDKs simplify the process of incorporating multimedia advertisements into your web pages and applications. They can request ads from any VAST-compliant ad server and handle the playback of the ads within the app. By using the IMA client-side SDKs, you retain control of the content video playback while the SDK manages the ad playback. The ads are displayed in a separate video player that is overlaid on top of the app's content video player.
Clientside Configuration
Attribute | Type | Required | Description |
---|---|---|---|
enabled | boolean | Yes | Enable the plugin (Defaults to false if no value is given.) |
adTagUrl | string | No | Ad Tag URL of the advertisement. (VAST, VPAID, VMAP, SIMID) |
liveStreamPrefetchSeconds | number | No | Inform IMA about when the ad should start loading before the ad shows in live streams. |
VAST Example
const config = {
...
ads: {
clientSide: {
provider: "gam",
gam: {
enabled: true,
adTagUrl:
"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=[LURA_CORRELATOR]",
}
}
}
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);
VMAP - Pre-roll Single Ad, Mid-roll Standard Pod with 3 ads, Post-roll Single Ad Example
const config = {
...
ads: {
clientSide: {
provider: "gam",
gam: {
enabled: true,
adTagUrl:
"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpostpod&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator=[LURA_CORRELATOR]",
}
}
}
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);
DAI Serverside
VOD Configuration
Attribute | Type | Required | Description |
---|---|---|---|
enabled | boolean | No | Enable the plugin (Defaults to false if no value is given.) |
cmsId | string | Yes | Content Source ID |
video | string | Yes | Video ID |
apiKey | string | No | API Key |
const config = {
...
ads: {
clientSide: {
provider: "gam",
gam: {
enabled: true,
cmsId: "2528370",
videoId: "tears-of-steel",
}
}
}
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);
Live Configuration
Attribute | Type | Required | Description |
---|---|---|---|
enabled | boolean | No | Enable the plugin (Defaults to false if no value is given.) |
assetKey | string | No | Asset Key |
apiKey | string | Yes | API Key |
const config = {
...
ads: {
clientSide: {
provider: "gam",
gam: {
enabled: true,
assetKey: "c-rArva4ShKVIAkNfy6HUQ",
}
}
}
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);
DAI Pod Serving
Attribute | Type | Required | Description |
---|---|---|---|
enabled | boolean | No | Enable the plugin (Defaults to false if no value is given.) |
networkCode | string | Yes | Network Code |
customAssetKey | string | Yes | Custom Asset Key |
apiKey | string | No | API Key |
const config = {
...
content: {
media: [
{
url: "https://encodersim.sandbox.google.com/masterPlaylist/9c654d63-5373-4673-8c8d-6d92b66b9d46/master.m3u8?gen-seg-redirect=true&network=51636543&event=google-sample&pids=devrel4628000,devrel896000,devrel3528000,devrel1428000,devrel2628000,devrel1928000&seg-host=dai.google.com&stream_id=[[STREAMID]]",
type: "application/x-mpegURL"
}
]
},
ads: {
clientSide: {
provider: "gam",
gam: {
enabled: true,
networkCode: "51636543",
customAssetKey: "google-sample",
}
}
}
...
};
const player = new lura.Player(document.getElementById("player"));
player.setConfig(config);