Adaptive Media Player

AmpCore Docs

AdBreakInfo

@objc
public class AdBreakInfo : NSObject

Container class for all the information related to the active ad break

  • Total amount of ads that the ad break contains

    The default value is 0

    Declaration

    Swift

    public var totalAds: Int
  • Total duration of the ad break

    The default value is 0.0

    Declaration

    Swift

    public var duration: Double
  • Placement of the ad break over the main content timeline

    The default value is 0

    Values:

    • 0: Preroll, the ad break is displayed before the main content has started.
    • 1: Midroll, the ad break is displayed during the main content. This may happen more than once.
    • 2: Postroll, the ad break is displayed after the main content has endded.

    Declaration

    Swift

    public var breakIndex: Int
  • Creates a container of the ad break information

    The breakIndex parameter should be:

    • 0 when the break is a preroll
    • 1 when the break is a midroll
    • 2 when the break is a postroll

    Declaration

    Swift

    @objc
    public init(totalAds: Int, duration: Double, breakIndex: Int)

    Parameters

    totalAds

    number of ads that the ad break contains

    duration

    total duration of the ad break in seconds

    breakIndex

    position of the ad break inside the main content timeline