CSAI
Client Side Ad Insertion
THEOplayer exposes GoogleImaAdDescription that could be used to achieve client side ad insertion. Using Google IMA requires the THEOplayer GoogleIMA Integration to be added to your project. For more information please refer here If you need to use Server Side Ad Insertion (SSAI), please consider checking its own documentation here.
GoogleInteractiveMediaAds.xcframework
The following is the support matrix for the GoogleInteractiveMediaAds SDK versions that THEOplayer is linked against. Although using a different version might work, we advise using the same version that THEOplayer is using to avoid any compatibility issues.
| PlayerVersion | GoogleInteractiveMediaAds versions |
|---|---|
| 11.X | iOS 3.31.0 - tvOS 4.16.0 |
-
Provides additional information for an advertisement.
See moreRemark
The description can be of typeGoogleImaAdDescription.Declaration
Swift
public protocol AdDescription -
Describes advertisements for a custom client-side ad integration.
See moreRemark
This API is experimental and may change in a future version.Declaration
Swift
open class CustomAdDescription : AdDescription -
The controller for a custom client-side ad integration.
Remark
This API is experimental and may change in a future version.See moreImportant
Call this controller and the player APIs on the main thread; calls from other threads crash.Declaration
Swift
@MainActor public protocol ClientSideAdIntegrationController : CustomAdIntegrationController -
A handler for a custom client-side ad integration.
See moreRemark
This API is experimental and may change in a future version.Declaration
Swift
public protocol ClientSideAdIntegrationHandler : CustomAdIntegrationHandler -
The content player exposed to a client-side ad integration. Reads and text tracks report the content, not the ad. Content changes and
play()/pause()calls after the integration is destroyed are ignored and logged.Event listeners use the public
PlayerEventTypesand player event objects.See moreRemark
This API is experimental and may change in a future version.Declaration
Swift
@MainActor public protocol AdContentPlayer : AnyObject, EventDispatcherProtocol -
A playback implementation used by a client-side integration for linear ads.
Remark
This API is experimental and may change in a future version.Declaration
Swift
@MainActor public protocol LinearAdPlayback : AnyObject -
A built-in player for media-backed linear ads in a client-side ad integration.
See moreRemark
This API is experimental and may change in a future version.Declaration
Swift
@MainActor public protocol LinearAdPlayer : EventDispatcherProtocol, LinearAdPlayback -
An error returned by the built-in linear ad player.
See moreDeclaration
Swift
public enum LinearAdPlayerError : LocalizedError -
The part of playback whose state and controls are routed during a linear ad break.
Declaration
Swift
public enum LinearAdBreakTarget -
Options for starting a linear ad break.
Remark
Whenplaybackisnil, the controller’s built-in linear ad player is used.Declaration
Swift
public struct StartLinearAdBreakOptions -
Options for ending a linear ad break.
Declaration
Swift
public struct EndLinearAdBreakOptions -
An error returned when a linear ad break cannot be started.
See moreDeclaration
Swift
public enum LinearAdBreakError : LocalizedError -
An
See moreAdDescriptionobject that will be added to the player when using the Google Ima ad integration.Declaration
Swift
open class GoogleImaAdDescription : NSObject, AdDescription, Codable
CSAI Reference