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
AdvertisingMetadata adBreakAsWatched property. Specifies the policy for marking an ad break as having been watched.
MediaPlayer Get the local time of the playback; seek to that time.
Note: getLocalTime in MediaPlayer returns the current time relative to the original content (without dynamically spliced ads). getLocalTime in AdBreak returns the start time of the break relative to the original content.
AdBreakPolicy Enumerates possible playback policies for ad breaks.
AdPolicy Enumerates possible playback policies for ads.
AdPolicySelector Interface that allows customization of the PSDK ad behavior.
DefaultAdPolicySelector 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.
MediaPlayer
  • getLocalTime. 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.