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.

    Remark

    The description can be of type GoogleImaAdDescription.
    See more

    Declaration

    Swift

    public protocol AdDescription
  • Describes advertisements for a custom client-side ad integration.

    Remark

    This API is experimental and may change in a future version.
    See more

    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.

    Important

    Call this controller and the player APIs on the main thread; calls from other threads crash.
    See more

    Declaration

    Swift

    @MainActor
    public protocol ClientSideAdIntegrationController : CustomAdIntegrationController
  • A handler for a custom client-side ad integration.

    Remark

    This API is experimental and may change in a future version.
    See more

    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 PlayerEventTypes and player event objects.

    Remark

    This API is experimental and may change in a future version.
    See more

    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.

    Remark

    This API is experimental and may change in a future version.
    See more

    Declaration

    Swift

    @MainActor
    public protocol LinearAdPlayer : EventDispatcherProtocol, LinearAdPlayback
  • An error returned by the built-in linear ad player.

    See more

    Declaration

    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

    When playback is nil, 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 more

    Declaration

    Swift

    public enum LinearAdBreakError : LocalizedError
  • An AdDescription object that will be added to the player when using the Google Ima ad integration.

    See more

    Declaration

    Swift

    open class GoogleImaAdDescription : NSObject, AdDescription, Codable
  • A GoogleImaAd is a concrete implementation of an Ad which represents a Google IMA ad.

    See more

    Declaration

    Swift

    public protocol GoogleImaAd : Ad