MediaContent

public interface MediaContent


Media content information.

Summary

Public methods

abstract float

The aspect ratio of the media content.

abstract float

The current time of the video in seconds.

abstract float

The duration of the video in seconds.

abstract boolean

Indicates whether the media content contains video.

abstract Drawable

The main image to be displayed if the media content doesn't contain video.

abstract VideoController

The media content's video controller.

abstract void

The main image to be displayed if the media content doesn't contain video.

Public methods

getAspectRatio

abstract float getAspectRatio()

The aspect ratio of the media content.

The aspect ratio of the video if hasVideoContent is true.

The aspect ratio of the main image if hasVideoContent is false.

getCurrentTime

abstract float getCurrentTime()

The current time of the video in seconds. Returns 0 if the media content does not contain video.

getDuration

abstract float getDuration()

The duration of the video in seconds. Returns 0 if media content does not contain video.

getHasVideoContent

abstract boolean getHasVideoContent()

Indicates whether the media content contains video.

getMainImage

abstract Drawable getMainImage()

The main image to be displayed if the media content doesn't contain video.

If you intend to render the media asset and you use NativeRequest.Builder.disableImageDownloading when loading native ads, you are responsible for setting this image when the returned ad does not contain video.

getVideoController

abstract VideoController getVideoController()

The media content's video controller.

setMainImage

abstract void setMainImage(Drawable mainImage)

The main image to be displayed if the media content doesn't contain video.

If you intend to render the media asset and you use NativeRequest.Builder.disableImageDownloading when loading native ads, you are responsible for setting this image when the returned ad does not contain video.