Native Video Ads
NAM SDK version 6.5.0 and above supports native video ads. The implementation method is the same as the existing native ad integration method. For cases that require specialized handling for native video ads, please refer to the guide below.
GfpMediaData
When using the native ad format, you can access the GfpMediaData object used to retrieve information about media assets drawn in GfpMediaView. You can obtain the GfpMediaData object by calling GfpNativeAd.getMediaData().
The example below shows how to query the aspect ratio value of a video through the GfpMediaData object when video content is loaded.
- Kotlin
- Java
val mediaData = nativeAd.mediaData
if (mediaData.mediaType == GfpMediaType.VIDEO) {
val mediaAspectRatio = mediaData.aspectRatio
}
GfpMediaData mediaData = nativeAd.getMediaData();
if (mediaData.getMediaType() == GfpMediaType.VIDEO) {
float mediaAspectRatio = mediaData.getAspectRatio();
}