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

  • GADMediaView displays native ad media content, such as video or images.

  • To use GADMediaView, add it as a subview to a GADNativeAdView and assign it to the native ad view's mediaView property.

  • Set the native ad's mediaContent property to the media view to display the content.

  • The mediaContent property determines what media is shown in the view.

GADMediaView


@interface GADMediaView : UIView

Displays native ad media content.

To display media content in GADNativeAdView instances, add a GADMediaView subview, assign the native ad view’s mediaView property, and set the native ad’s mediaContent property to the media view.

If the native ad contains video content, the media view displays the video content.

If the native ad doesn’t have video content and image loading is enabled, the media view displays the first image from the native ad’s |images| property.

If the native ad doesn’t have video content and image loading is disabled, the media view is empty.

  • The media content displayed in the media view.

    Declaration

    Swift

    var mediaContent: MediaContent? { get set }

    Objective-C

    @property (nonatomic, nullable) GADMediaContent *mediaContent;

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.