Skip to main content

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.

Plugin Name: ImaSdkPlugin

Plugin Config Name: ima

Clientside

Configuration

AttributeTypeRequiredDescription
adTagUrlstringfalseAd Tag URL of the advertisement. (VAST, VPAID, VMAP, SIMID)
Swift
let imaConfig = IMAPluginConfiguration(config: ["client": ["adTagUrl": "Your ad tag URL"]],
playerViewController: self)

DAI Serverside

VOD Configuration

AttributeTypeRequiredDescription
contentSourceIdstringYesContent Source ID
videoIdstringYesVideo ID
Swift
let imaConfig = IMAPluginConfiguration(config: ["dai": ["vod": ["contentSourceId": "Your content soude ID",
"videoId": "Your video ID"]]],
playerViewController: self)
let playerConfig = AktaPlayerConfiguration(requiredPluginsConfigurations: [imaConfig],
playerView: self.playerView,
eventListener: self.eventListener)
self.player = try? AktaPlayerCreator.playerWith(configuration: playerConfig)
let aktaMedia = AktaMedia()
aktaMedia.loadType = .imaDai
self.player?.load(media: aktaMedia, completion: { [weak self] loaded, error in
if loaded {
self?.player?.play()
}
})

Live Configuration

AttributeTypeRequiredDescription
assetKeystringNoAsset Key
Swift
let imaConfig = IMAPluginConfiguration(config: ["dai": ["live": ["assetKey": "Your asset key"]]],
playerViewController: self)
let playerConfig = AktaPlayerConfiguration(requiredPluginsConfigurations: [imaConfig],
playerView: self.playerView,
eventListener: self.eventListener)
self.player = try? AktaPlayerCreator.playerWith(configuration: playerConfig)
let aktaMedia = AktaMedia()
aktaMedia.loadType = .imaDai
self.player?.load(media: aktaMedia, completion: { [weak self] loaded, error in
if loaded {
self?.player?.play()
}
})

Pod Serving

Pod Serving Configuration

AttributeTypeRequiredDescription
networkCodestringYesNetwork Code
customAssetKeystringYesCustom Asset Key
streamUrlstringNoStream URL
Swift
let imaConfig = IMAPluginConfiguration(config: "dai": ["pod-serving": ["streamUrl": "Your stream URL",
"networkCode": "Your network code",
"customAssetKey": ""]]],
playerViewController: self)