ATVVideoPlayerDelegate

@protocol ATVVideoPlayerDelegate <NSObject>

Callback for video player events. Useful for analytic tracking.

  • Called when video playback is finished.

    Declaration

    Objective-C

    - (void)videoDidPlayFinished;

    Swift

    optional func videoDidPlayFinished()
  • Called when video player is dismissed.

    Declaration

    Objective-C

    - (void)playerDidDismiss;

    Swift

    optional func playerDidDismiss()
  • Called when video player will be dismissed.

    Declaration

    Objective-C

    - (void)playerWillDismiss;

    Swift

    optional func playerWillDismiss()
  • Called when the playhead is moved by user.

    Declaration

    Objective-C

    - (void)videoDidSeekTo:(double)second;

    Swift

    optional func videoDidSeek(to second: Double)

    Parameters

    second

    the new playhead position in seconds

  • Called when the player finishes buffering.

    Declaration

    Objective-C

    - (void)videoDidBuffer;

    Swift

    optional func videoDidBuffer()
  • Called when the player is waiting for buffering.

    Declaration

    Objective-C

    - (void)videoOnBuffer;

    Swift

    optional func videoOnBuffer()
  • Called when error occured during loading the video item.

    Declaration

    Objective-C

    - (void)videoOnError:(NSError *)error;

    Swift

    optional func video(onError error: Error!)

    Parameters

    error

    the error occured

  • Called when the player plays the video.

    Declaration

    Objective-C

    - (void)videoOnPlay;

    Swift

    optional func videoOnPlay()
  • Called when the player plays the video.

    Declaration

    Objective-C

    - (void)videoOnPlay:(double)second duration:(double)duration;

    Swift

    optional func video(onPlay second: Double, duration: Double)

    Parameters

    second

    current position in seconds

    duration

    video total duration

  • Called when the player is playing.

    Declaration

    Objective-C

    - (void)videoOnTime:(double)second;

    Swift

    optional func video(onTime second: Double)

    Parameters

    second

    current position in seconds

  • Called during video play.

    Declaration

    Objective-C

    - (void)videoOnTime:(double)second duration:(double)duration;

    Swift

    optional func video(onTime second: Double, duration: Double)

    Parameters

    second

    current position in seconds

    duration

    video total duration

  • Called when the player pauses.

    Declaration

    Objective-C

    - (void)videoOnPause:(double)second;

    Swift

    optional func video(onPause second: Double)

    Parameters

    second

    pause position in seconds

  • Called when the player pauses.

    Declaration

    Objective-C

    - (void)videoOnPause:(double)second duration:(double)duration;

    Swift

    optional func video(onPause second: Double, duration: Double)

    Parameters

    second

    pause position in seconds

    duration

    video total duration

  • Called when user change closed caption from info view. - parameter: languageCode selected languageCode

    Declaration

    Objective-C

    - (void)videoClosedCaptionDidChange:(NSString *)languageCode;

    Swift

    optional func videoClosedCaptionDidChange(_ languageCode: String!)

    Parameters

    languageCode

    selected languageCode

  • Called when start requesting ad.

    Declaration

    Objective-C

    - (void)videoAdOnRequest:(ATVAd *)adBreak;

    Swift

    optional func videoAd(onRequest adBreak: ATVAd!)

    Parameters

    adBreak

    fired ad break

  • Called when ad response and parsed successfully.

    Declaration

    Objective-C

    - (void)videoAdOnResponse:(ATVAd *)adBreak;

    Swift

    optional func videoAd(onResponse adBreak: ATVAd!)

    Parameters

    adBreak

    fired ad break

  • Called when the Ad start.

    Declaration

    Objective-C

    - (void)videoAdOnStart:(ATVAd *)adBreak;

    Swift

    optional func videoAd(onStart adBreak: ATVAd!)

    Parameters

    adBreak

    fired ad break

  • Called when ad is played

    Declaration

    Objective-C

    - (void)videoAdOnPlay:(ATVAd *)adBreak
                 duration:(double)duration
                   second:(double)second;

    Swift

    optional func videoAd(onPlay adBreak: ATVAd!, duration: Double, second: Double)

    Parameters

    adBreak

    fired ad break

    duration

    ad total duration

    second

    current position in seconds

  • Called when ad play reach certain quartile (first quartile, midpoint, third quartile)

    Declaration

    Objective-C

    - (void)videoAdOnPlayQuartile:(ATVAd *)adBreak
                         quartile:(ATVVastQuartile)quartile
                         duration:(double)duration;

    Swift

    optional func videoAd(onPlayQuartile adBreak: ATVAd!, quartile: ATVVastQuartile, duration: Double)

    Parameters

    adBreak

    fired ad break

    quartile

    quartile which playback reached

    duration

    ad total duration

  • Called during Ad play

    Declaration

    Objective-C

    - (void)videoAdOnTime:(ATVAd *)adBreak
                 duration:(double)duration
                   second:(double)second;

    Swift

    optional func videoAd(onTime adBreak: ATVAd!, duration: Double, second: Double)

    Parameters

    adBreak

    fired ad break

    duration

    ad total duration

    second

    current position in seconds

  • Called when Ad pause

    Declaration

    Objective-C

    - (void)videoAdOnPause:(ATVAd *)adBreak
                  duration:(double)duration
                    second:(double)second;

    Swift

    optional func videoAd(onPause adBreak: ATVAd!, duration: Double, second: Double)

    Parameters

    adBreak

    fired ad break

    duration

    ad total duration

    second

    pause position in second

  • Called when Ad complete

    Declaration

    Objective-C

    - (void)videoAdOnComplete:(ATVAd *)adBreak;

    Swift

    optional func videoAd(onComplete adBreak: ATVAd!)

    Parameters

    adBreak

    fired ad break

  • Called when ad is waiting for buffering

    Declaration

    Objective-C

    - (void)videoAdOnBuffer:(ATVAd *)adBreak
                   duration:(double)duration
                     second:(double)second;

    Swift

    optional func videoAd(onBuffer adBreak: ATVAd!, duration: Double, second: Double)

    Parameters

    adBreak

    fired ad break

  • Called when the first ad in a linear ad pod (a sequenced group of ads) has started

    Declaration

    Objective-C

    - (void)videoAdOnPodStart:(ATVAd *)adBreak;

    Swift

    optional func videoAd(onPodStart adBreak: ATVAd!)

    Parameters

    adBreak

    fired ad break

  • Called when the last ad in a linear ad pod (a sequenced group of ads) has finished

    Declaration

    Objective-C

    - (void)videoAdOnPodComplete:(ATVAd *)adBreak;

    Swift

    optional func videoAd(onPodComplete adBreak: ATVAd!)

    Parameters

    adBreak

    fired ad break

  • Called when Ad error

    Declaration

    Objective-C

    - (void)videoAdOnError:(ATVAd *)adBreak error:(NSString *)error;

    Swift

    optional func videoAd(onError adBreak: ATVAd!, error: String!)

    Parameters

    adBreak

    fired ad break

    error

    error description in string

  • Called when Ad error

    Declaration

    Objective-C

    - (void)videoAdOnError:(ATVAd *)adBreak
                     error:(ATVVastError)error
                      desc:(NSString *)desc;

    Swift

    optional func videoAd(onError adBreak: ATVAd!, error: ATVVastError, desc: String!)

    Parameters

    adBreak

    fired ad break

    error

    error enum

    desc

    error description