Customize playback with ads

When playback reaches or passes an ad break or ends within an ad break, the PSDK defines certain default behavior for the positioning of the current playhead. You can override the default behavior through the PTAdPolicySelector class.

The default behavior might vary depending on whether the user passed the ad break during normal playback or by seeking in a video.

Here are some ideas for possible ad-playback behavior customization.

  • Save the position in a video where the user stopped watching and resume the user at the same position in a future session.
  • If an ad break is presented to the user, display no more ads for some number of minutes even if the user seeks to a new position.
  • If the content fails to play (live or VOD) after a few minutes, restart the stream or fail over to a different source for the same content.

    On the fail-over playback session, you might want to disable pre-roll and/or mid-roll ads to allow the user to skip ads and resume to the previous failed position. The PSDK provides methods to enable skipping pre-roll and mid-roll ads.