To discuss and provide feedback on our products, join the official AdMob Discord channel in the Google Advertising and Measurement Community server.

GoogleMobileAds Framework Reference

  • GADVideoController manages video content for ads rendered by the Google Mobile Ads SDK and provides video metadata.

  • You obtain an instance of GADVideoController from a rendered ad object, as you do not create an instance yourself.

  • Key properties include delegate for receiving video notifications, muted to control audio, customControlsEnabled to check for custom controls, and clickToExpandEnabled to check for click-to-expand behavior.

  • The class provides methods like play, pause, and stop to control video playback when custom controls are enabled.

GADVideoController


@interface GADVideoController : NSObject

The video controller class provides a way to get the video metadata and also manages video content of the ad rendered by the Google Mobile Ads SDK. You don’t need to create an instance of this class. When the ad rendered by the Google Mobile Ads SDK loads video content, you may be able to get an instance of this class from the rendered ad object.

  • Delegate for receiving video notifications.

    Declaration

    Swift

    weak var delegate: (any GADVideoControllerDelegate)? { get set }

    Objective-C

    @property (nonatomic, weak, nullable) id<GADVideoControllerDelegate> delegate;
  • Indicates whether the video is muted. Set to YES to mute the video. Set to NO to allow the video to play sound. The setter doesn’t do anything if -customControlsEnabled returns NO.

    Declaration

    Swift

    var isMuted: Bool { get set }

    Objective-C

    @property (nonatomic, getter=isMuted) BOOL muted;
  • Indicates whether video custom controls (for example, play/pause/mute/unmute) are enabled.

    Declaration

    Swift

    var areCustomControlsEnabled: Bool { get }

    Objective-C

    @property (nonatomic, readonly, getter=areCustomControlsEnabled) BOOL customControlsEnabled;
  • Indicates whether video click to expand behavior is enabled.

    Declaration

    Swift

    var isClickToExpandEnabled: Bool { get }

    Objective-C

    @property (nonatomic, readonly, getter=isClickToExpandEnabled) BOOL clickToExpandEnabled;
  • Play the video. Doesn’t do anything if the video is already playing or if -customControlsEnabled returns NO.

    Declaration

    Swift

    func play()

    Objective-C

    - (void)play;
  • Pause the video. Doesn’t do anything if the video is already paused or if -customControlsEnabled- returns NO.

    Declaration

    Swift

    func pause()

    Objective-C

    - (void)pause;
  • Stops the video and displays the video’s first frame. Call -play to resume playback at the start of the video. Doesn’t do anything if -customControlsEnabled returns NO.

    Declaration

    Swift

    func stop()

    Objective-C

    - (void)stop;

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年08月20日 UTC.