GADInstreamAd

@interface GADInstreamAd : NSObject

An instream ad.

  • Loads an instream ad with the provided ad unit ID. Instream ads only support GADMediaAspectRatioLandscape and GADMediaAspectRatioPortrait media aspect ratios, defaulting to GADMediaAspectRatioLandscape. Calls the provided completion handler when the ad load completes.

    Declaration

    Swift

    class func loadAd(withAdUnitID adUnitID: String, request: GADRequest?, mediaAspectRatio: GADMediaAspectRatio, completionHandler: @escaping GADInstreamAdLoadCompletionHandler)

    Objective-C

    + (void)loadAdWithAdUnitID:(nonnull NSString *)adUnitID
                       request:(nullable GADRequest *)request
              mediaAspectRatio:(GADMediaAspectRatio)mediaAspectRatio
             completionHandler:
                 (nonnull GADInstreamAdLoadCompletionHandler)completionHandler;
  • Loads an instream ad with the provided ad tag. Calls the provided completion handler when the ad load completes.

    Declaration

    Swift

    class func loadAd(withAdTag adTag: String, completionHandler: @escaping GADInstreamAdLoadCompletionHandler)

    Objective-C

    + (void)loadAdWithAdTag:(nonnull NSString *)adTag
          completionHandler:
              (nonnull GADInstreamAdLoadCompletionHandler)completionHandler;
  • Video controller for controlling to the video rendered by the instream ad.

    Declaration

    Swift

    var videoController: GADVideoController? { get }

    Objective-C

    @property (readonly, nonatomic, nullable) GADVideoController *videoController;
  • Information about the ad response that returned the ad.

    Declaration

    Swift

    var responseInfo: GADResponseInfo { get }

    Objective-C

    @property (readonly, nonatomic, nonnull) GADResponseInfo *responseInfo;
  • Video duration.

    Declaration

    Swift

    var duration: TimeInterval { get }

    Objective-C

    @property (readonly, nonatomic) NSTimeInterval duration;
  • Video’s current time.

    Declaration

    Swift

    var currentTime: TimeInterval { get }

    Objective-C

    @property (readonly, nonatomic) NSTimeInterval currentTime;
  • Video aspect ratio (width/height).

    Declaration

    Swift

    var aspectRatio: CGFloat { get }

    Objective-C

    @property (readonly, nonatomic) CGFloat aspectRatio;