InstreamAdBreak

@objc(YMAInstreamAdBreak)
@MainActor
public protocol InstreamAdBreak

This class is responsible for playing ad breaks.

  • This object will be notified about the pauseroll playback events.

    Declaration

    Swift

    @MainActor
    var delegate: InstreamAdBreakDelegate? { get set }
  • AdBreakData associated with this roll.

    Declaration

    Swift

    @MainActor
    var adBreakData: AdBreakData { get }
  • Prepare roll playback. Note that prepare should always be called before play method.

    Declaration

    Swift

    @MainActor
    func prepare(with adPlayer: InstreamAdPlayer)

    Parameters

    adPlayer

    player to play pauseroll.

  • Start roll playback. Note that you can call play only on a prepared pauseroll.

    Declaration

    Swift

    @MainActor
    func play(with adView: InstreamAdView)

    Parameters

    adView

    the view in which pauseroll will be displayed.

  • Pause roll playback.

    Declaration

    Swift

    @MainActor
    func pause()
  • Resume paused roll playback.

    Declaration

    Swift

    @MainActor
    func resume()
  • Invalidate roll playback. Call this method right before ad player is invalidated. To resume playback after invalidation you should prepare and start pauseroll again.

    Declaration

    Swift

    @MainActor
    func invalidate()