MediaContent

interface MediaContent


Media content information.

Summary

Public properties

Float

The aspect ratio of the media content.

Float

The current time of the video in seconds.

Float

The duration of the video in seconds.

Boolean

Indicates whether the media content contains video.

Drawable?

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

VideoController?

The media content's video controller.

Public properties

aspectRatio

val aspectRatio: Float

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.

currentTime

val currentTime: Float

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

duration

val duration: Float

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

hasVideoContent

val hasVideoContent: Boolean

Indicates whether the media content contains video.

mainImage

var mainImage: Drawable?

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.

videoController

val videoController: VideoController?

The media content's video controller.