Other Constants

The following constants are available globally.

Notifications

  • Posted when the fullscreen button was pressed and internal fullscreen handling is disabled

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerToggleFullscreenNotification

    Swift

    static let APSMediaPlayerToggleFullscreen: NSNotification.Name
  • Posted before the media player enters fullscreen

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerWillEnterFullscreenNotification

    Swift

    static let APSMediaPlayerWillEnterFullscreen: NSNotification.Name
  • Posted after the media player enters fullscreen

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerDidEnterFullscreenNotification

    Swift

    static let APSMediaPlayerDidEnterFullscreen: NSNotification.Name
  • Posted before the media player exists fullscreen

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerWillExitFullscreenNotification

    Swift

    static let APSMediaPlayerWillExitFullscreen: NSNotification.Name
  • Posted after the media player exists fullscreen

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerDidExitFullscreenNotification

    Swift

    static let APSMediaPlayerDidExitFullscreen: NSNotification.Name
  • Posted before starting Picture in Picture mode

    Declaration

    Objective-C

    extern NSString
        *const _Nonnull APSMediaPlayerWillStartPictureInPictureNotification

    Swift

    static let APSMediaPlayerWillStartPictureInPicture: NSNotification.Name
  • Posted after Picture in Picture mode was started

    Declaration

    Objective-C

    extern NSString
        *const _Nonnull APSMediaPlayerDidStartPictureInPictureNotification

    Swift

    static let APSMediaPlayerDidStartPictureInPicture: NSNotification.Name
  • Posted before stopping Picture in Picture mode

    Declaration

    Objective-C

    extern NSString
        *const _Nonnull APSMediaPlayerWillStopPictureInPictureNotification

    Swift

    static let APSMediaPlayerWillStopPictureInPicture: NSNotification.Name
  • Posted after stopping Picture in Picture mode

    Declaration

    Objective-C

    extern NSString
        *const _Nonnull APSMediaPlayerDidStopPictureInPictureNotification

    Swift

    static let APSMediaPlayerDidStopPictureInPicture: NSNotification.Name
  • Posted when the user taps on the media player surface

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerWasTappedNotification

    Swift

    static let APSMediaPlayerWasTapped: NSNotification.Name
  • Posted when the video controls bar becomes visible

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerControlsDisplayedNotification

    Swift

    static let APSMediaPlayerControlsDisplayed: NSNotification.Name
  • Posted when the video controls bar becomes hidden

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerControlsHiddenNotification

    Swift

    static let APSMediaPlayerControlsHidden: NSNotification.Name
  • Posted every time the internal status of the media player changes. This will happen roughly once every second.

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerUpdateNotification

    Swift

    static let APSMediaPlayerUpdate: NSNotification.Name
  • Posted when a media unit finishes playback, before the remaining playlist units are processed. The userInfo dictionary contains the APSMediaUnit object that just finished playback under the KAPSMediaPlayerCurrentUnit key.

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerUnitFinishedNotification

    Swift

    static let APSMediaPlayerUnitFinished: NSNotification.Name
  • Posted when the media player encounters an error in the process of unit playback. The userInfo dictionary contains the NSError object that represents the error under the error key.

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerErrorNotification

    Swift

    static let APSMediaPlayerError: NSNotification.Name
  • Posted when the media player playback state has changed. You can immediately get the new state using the playbackState method of the APSMediaPlayer instance.

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerStatusChangedNotification

    Swift

    static let APSMediaPlayerStatusChanged: NSNotification.Name
  • Posted when a trackable playback event occurs. The userinfo dictionary contains additional information about the tracked event:

    • the kAPSMediaPlayerEventDescription key returns a string description of the tracked event
    • the kAPSMediaPlayerEventType key returns one of the possible event type constants
    • the kAPSMediaPlayerEventURLs key returns an array of NSURLs that were pinged to track the event
    • the kAPSMediaPlayerCurrentPlaybackTime key returns the playback time when the event was triggered
    • the kAPSMediaPlayerCurrentDuration key returns the total duration of the unit that triggered the event
    • the kAPSMediaPlayerError is present in case the event signals an error
    • the kAPSMediaPlayerSeekStart is present for APSMediaPlayerEventSeeked events and indicates the playback time when the seek started
    • the kAPSMediaPlayerSeekTo is present for APSMediaPlayerEventSeeked events and indicates the requested playback time to seek to

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerTrackedEventNotification

    Swift

    static let APSMediaPlayerTrackedEvent: NSNotification.Name
  • Posted when the player license is invalid. Playback will be disabled.

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerInvalidLicenseNotification

    Swift

    static let APSMediaPlayerInvalidLicense: NSNotification.Name
  • Posted when the internal minibrowser will open because an ad was tapped

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerWillOpenMiniBrowser

    Swift

    let APSMediaPlayerWillOpenMiniBrowser: String
  • Posted when the internal minibrowser will be dismissed

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerWillCloseMiniBrowser

    Swift

    let APSMediaPlayerWillCloseMiniBrowser: String
  • Posted when the internal player backend finished playback

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerPlaybackDidFinishNotification

    Swift

    static let APSMediaPlayerPlaybackDidFinish: NSNotification.Name
  • Posted when the media load state changed

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerLoadStateDidChangeNotification

    Swift

    static let APSMediaPlayerLoadStateDidChange: NSNotification.Name
  • Posted when the duration of the played media becomes available

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerDurationAvailableNotification

    Swift

    static let APSMediaPlayerDurationAvailable: NSNotification.Name
  • Posted when the media playback state changed

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerPlaybackStateDidChangeNotification

    Swift

    static let APSMediaPlayerPlaybackStateDidChange: NSNotification.Name
  • Posted when the volume changed

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerVolumeDidChangeNotification

    Swift

    static let APSMediaPlayerVolumeDidChange: NSNotification.Name

Available Tracking Events



  • Declaration

    Objective-C

    extern NSString *const _Nonnull APSMediaPlayerEventLaunch

    Swift

    let APSMediaPlayerEventLaunch: String
  • Posted when Picture in Picture mode is not possible

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSPipPlayerNotPossible

    Swift

    let APSPipPlayerNotPossible: String
  • Posted when Picture in Picture mode is not supported

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSPipPlayerNotSupported

    Swift

    let APSPipPlayerNotSupported: String
  • Posted when the the player failed to initiate Picture in Picture mode

    Declaration

    Objective-C

    extern NSString
        *const _Nonnull APSPipPlayerFailedToStartPictureInPictureWithError

    Swift

    let APSPipPlayerFailedToStartPictureInPictureWithError: String
  • Posted before the player will start Picture in Picture mode

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSPipPlayerWillStartPictureInPicture

    Swift

    let APSPipPlayerWillStartPictureInPicture: String
  • Posted after the player did start Picture in Picture mode

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSPipPlayerDidStartPictureInPicture

    Swift

    let APSPipPlayerDidStartPictureInPicture: String
  • Posted before the player will stop Picture in Picture mode

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSPipPlayerWillStopPictureInPicture

    Swift

    let APSPipPlayerWillStopPictureInPicture: String
  • Posted after the player did stop Picture in Picture mode

    Declaration

    Objective-C

    extern NSString *const _Nonnull APSPipPlayerDidStopPictureInPicture

    Swift

    let APSPipPlayerDidStopPictureInPicture: String