Advertising API elements for playback

The PSDK provides classes and methods with which you can customize the playback behavior of content that contains advertising.

The following API elements are useful for customizing playback:
API element Provides
PTAdMetadata adBreakAsWatched property. Specifies the policy for marking an ad break as having been watched.
PTAdBreak Whether an ad has been watched.
PTMediaPlayer Get the local time of the playback; seek to that time.
PTAdPolicySelector Protocol that allows customization of the PSDK ad behavior.
PTDefaultAdPolicySelector Class that implements the default PSDK behavior. Your application can override this class to customize one or more of the default behaviors without having to implement the full interface.
PTMediaPlayer
  • localTime. The local time of the playback excluding the placed ad breaks.
  • seekToLocalTime. Seeks to a local time in stream.
  • convertToLocalTime. Converts a virtual position on the timeline to the local position.