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
secondthe 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
errorthe 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
secondcurrent position in seconds
durationvideo total duration
-
Called when the player is playing.
Declaration
Objective-C
- (void)videoOnTime:(double)second;Swift
optional func video(onTime second: Double)Parameters
secondcurrent 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
secondcurrent position in seconds
durationvideo total duration
-
Called when the player pauses.
Declaration
Objective-C
- (void)videoOnPause:(double)second;Swift
optional func video(onPause second: Double)Parameters
secondpause 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
secondpause position in seconds
durationvideo 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
languageCodeselected languageCode
-
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
adBreakfired ad break
durationad total duration
secondcurrent 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
adBreakfired ad break
quartilequartile which playback reached
durationad 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
adBreakfired ad break
durationad total duration
secondcurrent 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
adBreakfired ad break
durationad total duration
secondpause position in second
-
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
adBreakfired ad break
errorerror enum
descerror description
ATVVideoPlayerDelegate Protocol Reference