ClientSideAdIntegrationController

@MainActor
public protocol ClientSideAdIntegrationController : CustomAdIntegrationController

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.
  • The content player controlled by the integration. Reads report the content, not the ad.

    Declaration

    Swift

    @MainActor
    var content: AdContentPlayer { get }
  • The integration-owned overlay view covering the player view and staying above the content.

    The view moves with the player when it enters fullscreen. Touches pass through to the player except on this view’s subviews. On tvOS, the integration is responsible for focus handling for views added to this container.

    After the integration is destroyed, changes to the view are ignored.

    Declaration

    Swift

    @MainActor
    var adContainer: UIView { get }
  • The stable view hosting the content. Changes after the integration is destroyed are ignored.

    Declaration

    Swift

    @MainActor
    var contentView: UIView { get }
  • The built-in player for media-backed linear ads.

    Declaration

    Swift

    @MainActor
    var linearAdPlayer: LinearAdPlayer { get }
  • Starts a linear ad break using the integration’s playback.

    Declaration

    Swift

    @MainActor
    func startLinearAdBreak(options: StartLinearAdBreakOptions) throws
  • Updates the public player state and events from the active ad playback.

    Declaration

    Swift

    @MainActor
    func updateLinearAdBreak()
  • Ends the active linear ad break, if there is one.

    Declaration

    Swift

    @MainActor
    func endLinearAdBreak(options: EndLinearAdBreakOptions)
  • startLinearAdBreak() Extension method

    Starts a linear ad break with the default options.

    Declaration

    Swift

    @MainActor
    func startLinearAdBreak() throws
  • endLinearAdBreak() Extension method

    Ends the active linear ad break with the default options.

    Declaration

    Swift

    @MainActor
    func endLinearAdBreak()