This document describes the steps required for adding support for the IMA Plugin functionality on iOS devices. IMA (or Interactive Media Ads) was developed by Google to enable you to display ads in your application’s video, audio, and game content. To learn more about Google’s IMA, see Google’s IMA developer’s site.
Supported IMA SDK Version is: 3.5.2
- There is currently an open issue with IMA SDK where removing the player view before destroying the ads manager will cause an error on the next ad playback. To fix the issue all you have to do is call the
If you get below error:
Please make sure that the order of removing player on your side is:
- When not including ads, the PlayerEvent observed events start occurring after calling prepare().
When including ads, none of the PlayerAd events occur after calling prepare().
To resolve this issue and get
autoPlay with ads please make sure to call play() before those events start occurring.
To enable the IMA Plugin on iOS devices for the Kaltura Video Player, add the following line to your Podfile:
To control ad play during runtime, implement the following Video Player delegate method:
Next, register the IMA Plugin inside your application as follows:
To configure the player to use IMA Plugin, add the following configuration to your
PlayerConfig file as follows:
The IMA Plugin offers two options for opening ad landing pages:
- Via an in-app browser
- Via Safari
By default, the plugin will open pages using Safari. To update the plugin to use an in-app browser, you’ll need to set the
webOpenerPresentingController value in the AdsConfig object as follows:
To see companion ads in the device, you’ll need to implement the following steps:
- Configure an ad tag to return a companion ad (prepare this in advance).
- Supply a companion ad container to the plugin using the following format (make sure the size of the companion being returned is the same size as the UIView in which you’re trying to display it):
The IMA Plugin enables you to specify the video formats and bitrate using the following configuration:
The IMA Plugin enables you to specify the language to be used to localize ads and the Video Player UI controls.
To do so, set the language parameter of the AdsConfig to the appropriate language code using this reference.
Use the following code to listen to ad events:
To observe ad info when an ad is starting use the following:
To observe ad cue points update use the following:
Check out the Kaltura Player SDK Forum page for different ways of getting in touch.