GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
@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 }
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eGADMediaView is a UIView subclass used to display native ad media content, such as video or images, within GADNativeAdView instances.\u003c/p\u003e\n"],["\u003cp\u003eTo use GADMediaView, add it as a subview, assign it to the native ad view's \u003ccode\u003emediaView\u003c/code\u003e property, and set the native ad's \u003ccode\u003emediaContent\u003c/code\u003e to the media view.\u003c/p\u003e\n"],["\u003cp\u003eIf the ad has video, GADMediaView displays it; if not, it displays the first image from the ad's \u003ccode\u003eimages\u003c/code\u003e property if image loading is enabled.\u003c/p\u003e\n"],["\u003cp\u003eWhen the ad lacks video content and image loading is disabled, the GADMediaView remains empty, showing no content.\u003c/p\u003e\n"]]],["GADMediaView displays media content from native ads. To use it, add it as a subview to a GADNativeAdView, assign it to the native ad view's `mediaView` property, and set the native ad's `mediaContent` property. It displays video if available, otherwise, it shows the first image from the ad's `images` property (if enabled) or remains empty (if disabled). The `mediaContent` property is how you assign the content to display.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADMediaView\n============\n\n\n @interface GADMediaView : UIView\n\nDisplays native ad media content.\n\nTo display media content in GADNativeAdView instances, add a GADMediaView subview,\nassign the native ad view's mediaView property, and set the native ad's mediaContent property to\nthe media view.\n\nIf the native ad contains video content, the media view displays the video content.\n\nIf the native ad doesn't have video content and image loading is enabled, the media view\ndisplays the first image from the native ad's \\|images\\| property.\n\nIf the native ad doesn't have video content and image loading is disabled, the media view is\nempty.\n- `\n ``\n ``\n `\n\n ### [mediaContent](#/c:objc(cs)GADMediaView(py)mediaContent)\n\n `\n ` \n The media content displayed in the media view. \n\n #### Declaration\n\n Swift \n\n var mediaContent: MediaContent? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) ../Classes/GADMediaContent.html *mediaContent;"]]