GoogleInteractiveMediaAds Framework Reference

IMAVideoDisplayDelegate

@protocol IMAVideoDisplayDelegate <NSObject>

Delegate object that receives state change callbacks from IMAVideoDisplay.

  • Informs the SDK that the ad has loaded.

    Declaration

    Swift

    func videoDisplayDidLoad(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidLoad:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that loaded the ad

  • Informs the SDK the ad has started playback. This must be called at most once per loadStream: or loadUrl: call.

    Declaration

    Swift

    func videoDisplayDidStart(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidStart:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that started ad playback

  • Informs the SDK the ad has paused.

    Declaration

    Swift

    func videoDisplayDidPause(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidPause:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that paused ad playback

  • Informs the SDK the ad has resumed playback.

    Declaration

    Swift

    func videoDisplayDidResume(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidResume:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that resumed ad playback

  • Informs the SDK the ad has completed playback.

    Declaration

    Swift

    func videoDisplayDidComplete(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidComplete:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that completed ad playback

  • Informs the SDK the ad was clicked.

    Declaration

    Swift

    func videoDisplayDidClick(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidClick:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that received the ad click

  • Informs the SDK the ad playback failed due to an error.

    Declaration

    Swift

    func videoDisplay(_ videoDisplay: any IMAVideoDisplay, didReceiveError error: any Error)

    Objective-C

    - (void)videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
         didReceiveError:(nonnull NSError *)error;

    Parameters

    videoDisplay

    the IMAVideoDisplay that failed to play the ad

    error

    the error that caused the video display to fail to play the ad

  • Informs the SDK the ad was skipped.

    Declaration

    Swift

    func videoDisplayDidSkip(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidSkip:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that skipped the ad

  • Informs the SDK the ad skip button appeared.

    Declaration

    Swift

    func videoDisplayDidShowSkip(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidShowSkip:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that showed the skip button

  • Informs the SDK that the ad volume was changed.

    Declaration

    Swift

    func videoDisplay(_ videoDisplay: any IMAVideoDisplay, volumeChangedTo volume: NSNumber)

    Objective-C

    - (void)videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
         volumeChangedTo:(nonnull NSNumber *)volume;

    Parameters

    videoDisplay

    the IMAVideoDisplay that changed the ad volume

    volume

    the new volume of the ad being played

  • Informs the SDK that the video ad progressed.

    Declaration

    Swift

    func videoDisplay(_ videoDisplay: any IMAVideoDisplay, didProgressWithMediaTime mediaTime: TimeInterval, totalTime duration: TimeInterval)

    Objective-C

    - (void)videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
        didProgressWithMediaTime:(NSTimeInterval)mediaTime
                       totalTime:(NSTimeInterval)duration;

    Parameters

    videoDisplay

    the IMAVideoDisplay that progressed

    mediaTime

    the current time of the ad being played

    duration

    the total duration of the ad being played

  • Informs the SDK that timed metadata was received.

    Declaration

    Swift

    func videoDisplay(_ videoDisplay: any IMAVideoDisplay, didReceiveTimedMetadata metadata: [String : String])

    Objective-C

    - (void)videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
        didReceiveTimedMetadata:
            (nonnull NSDictionary<NSString *, NSString *> *)metadata;

    Parameters

    videoDisplay

    the IMAVideoDisplay that received the timed metadata event

    metadata

    the metadata dictionary received with the timed metadata event

  • Informs the SDK the video ad is buffered to |mediaTime| in seconds.

    Declaration

    Swift

    optional func videoDisplay(_ videoDisplay: any IMAVideoDisplay, didBufferToMediaTime mediaTime: TimeInterval)

    Objective-C

    - (void)videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
        didBufferToMediaTime:(NSTimeInterval)mediaTime;

    Parameters

    videoDisplay

    the IMAVideoDisplay whose buffer was updated

    mediaTime

    the time in seconds of ad media that has been buffered.

  • Informs the SDK the ad is buffered and playback is likely to keep up.

    Declaration

    Swift

    optional func videoDisplayIsPlaybackReady(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayIsPlaybackReady:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that is playback ready

  • Informs the SDK the ad’s media buffer is empty and playback will stall.

    Declaration

    Swift

    optional func videoDisplayDidStartBuffering(_ videoDisplay: any IMAVideoDisplay)

    Objective-C

    - (void)videoDisplayDidStartBuffering:(nonnull id<IMAVideoDisplay>)videoDisplay;

    Parameters

    videoDisplay

    the IMAVideoDisplay that started buffering