iOS SDK Ads

SpotX pre-integration

To configure the player to play SpotX ads, Google IMA should be configured.

let playerConfig = THEOplayerConfiguration(googleIMA: true)
var theoplayer = THEOplayer(configuration: playerConfig)

Next add a SpotX ad configuration to the sources

let typedSource = TypedSource(src: "https://www.examples.com/index.m3u8",  type:  "application/x-mpegurl")
let deviceParam = SpotxData(stringParameters: ["ifa": "38400000-8cf0-11bd-b23e-10b96e40000d"],  intParameters: ["dnt": 1, "lmt": 1], geoParameter: Geo(lat: -24.378528, lon: -128.325119))
let adDesc = SpotXAdDescription(id: "12345", cacheBuster: true, device: deviceParam)
let source = SourceDescription(source: typedSource, ads: [adDesc])
theoplayer.source = source