AdContentPlayer

@MainActor
public protocol AdContentPlayer : AnyObject, EventDispatcherProtocol

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.
  • The current playback position of the content, in seconds.

    Declaration

    Swift

    @MainActor
    var currentTime: Double { get set }
  • The content duration, in seconds.

    Declaration

    Swift

    @MainActor
    var duration: Double? { get }
  • Whether the content is paused.

    Declaration

    Swift

    @MainActor
    var paused: Bool { get }
  • Whether the content has ended.

    Declaration

    Swift

    @MainActor
    var ended: Bool { get }
  • Whether the content is seeking.

    Declaration

    Swift

    @MainActor
    var seeking: Bool { get }
  • The seekable ranges of the content.

    Declaration

    Swift

    @MainActor
    var seekable: [TimeRange] { get }
  • The buffered ranges of the content.

    Declaration

    Swift

    @MainActor
    var buffered: [TimeRange] { get }
  • The current ready state of the content.

    Declaration

    Swift

    @MainActor
    var readyState: ReadyState { get }
  • The current program date time, if available.

    Declaration

    Swift

    @MainActor
    var currentProgramDateTime: Date? { get }
  • The video height in pixels.

    Declaration

    Swift

    @MainActor
    var videoHeight: Int { get }
  • The video width in pixels.

    Declaration

    Swift

    @MainActor
    var videoWidth: Int { get }
  • The current playback rate.

    Declaration

    Swift

    @MainActor
    var playbackRate: Double { get }
  • The content’s text tracks.

    Declaration

    Swift

    @MainActor
    var textTracks: TextTrackList { get }
  • The content playback volume.

    Declaration

    Swift

    @MainActor
    var volume: Float { get set }
  • Whether the content audio is muted.

    Declaration

    Swift

    @MainActor
    var muted: Bool { get set }
  • Starts content playback. Calls after the integration is destroyed are ignored.

    Declaration

    Swift

    @MainActor
    func play()
  • Pauses content playback. Calls after the integration is destroyed are ignored.

    Declaration

    Swift

    @MainActor
    func pause()