AI-generated Key Takeaways
-
GADMediaView is a UIView subclass used to display native ad media content, such as video or images, within GADNativeAdView instances.
-
To use GADMediaView, add it as a subview, assign it to the native ad view's
mediaView
property, and set the native ad'smediaContent
to the media view. -
If the ad has video, GADMediaView displays it; if not, it displays the first image from the ad's
images
property if image loading is enabled. -
When the ad lacks video content and image loading is disabled, the GADMediaView remains empty, showing no content.
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;