API elements for ad playback

Last update: 2023-10-02

TVSDK provides classes and methods you can use to customize the playback behavior of content that contains advertising.

The following API elements are useful for customizing playback:

API element Content that supports advertising
AdvertisingMetadata Control whether an ad break should be marked as having been watched by a viewer, and if yes, when to mark it. Set and get the watched policy using
      adBreakAsWatched property.
AdBreakPolicy Enumerates possible playback policies for ad breaks.
AdPolicy Enumerates possible playback policies for ads.
AdPolicySelector Interface that allows customization of TVSDK ad behavior.
DefaultAdPolicySelector Class that implements the default TVSDK behavior. Your application can override this class to customize the default behaviors without implementing the complete interface.
  • localTime.

    This is the local time of the playback, excluding the placed ad breaks.

  • seekToLocal.

    Here, the seek occurs relative to a local time in the stream.

  • getTimeline.convertToLocalTime.

    The virtual position on the timeline is converted to the local position.

  • watched.

    Indicates whether the viewer has watched the ad.

  • localRange.

    The starting position and the duration of an ad break or ad relative to the original content.

  • virtualRange.

    The starting position and the duration of an ad break or ad on the virtual timeline after considering all of the placed ad breaks.

On this page