class MediaItem


Representation of a media item.

Summary

Nested types

Configuration for playing back linear ads with a media item.

Builder for AdsConfiguration instances.

A builder for MediaItem instances.

Optionally clips the media item to a custom start and end position.

Builder for ClippingConfiguration instances.

This class is deprecated.

Use ClippingConfiguration instead.

DRM configuration for a media item.

Builder for DrmConfiguration.

Live playback configuration.

Builder for LiveConfiguration instances.

Properties for local playback.

Metadata that helps the player to understand a playback request represented by a .

Builder for RequestMetadata instances.

This class is deprecated.

Use MediaItem.SubtitleConfiguration instead

Properties for a text track.

Builder for SubtitleConfiguration instances.

Constants

const String!

The default media ID that is used if the media ID is not explicitly set by setMediaId.

const MediaItem!

Empty MediaItem.

Public functions

MediaItem.Builder!

Returns a Builder initialized with the values of this instance.

Boolean
equals(obj: Any?)
java-static MediaItem!

Restores a MediaItem from a Bundle.

java-static MediaItem!
fromUri(uri: String!)

Creates a MediaItem for the given URI.

java-static MediaItem!
fromUri(uri: Uri!)

Creates a MediaItem for the given URI.

Int
Bundle!

Returns a Bundle representing the information stored in this object.

Bundle!

Returns a Bundle representing the information stored in this MediaItem object, while including the localConfiguration field if it is not null (otherwise skips it).

Public properties

MediaItem.ClippingConfiguration!

The clipping properties.

MediaItem.ClippingProperties!

This property is deprecated.

Use clippingConfiguration instead.

MediaItem.LiveConfiguration!

The live playback configuration.

MediaItem.LocalConfiguration?

Optional configuration for local playback.

String!

Identifies the media item.

MediaMetadata!

The media metadata.

MediaItem.LocalConfiguration?

This property is deprecated.

Use localConfiguration instead.

MediaItem.RequestMetadata!

The media RequestMetadata.

Constants

DEFAULT_MEDIA_ID

const val DEFAULT_MEDIA_ID = "": String!

The default media ID that is used if the media ID is not explicitly set by setMediaId.

EMPTY

const val EMPTYMediaItem!

Empty MediaItem.

Public functions

buildUpon

fun buildUpon(): MediaItem.Builder!

Returns a Builder initialized with the values of this instance.

equals

fun equals(obj: Any?): Boolean

fromBundle

@UnstableApi
java-static fun fromBundle(bundle: Bundle!): MediaItem!

Restores a MediaItem from a Bundle.

The localConfiguration of a restored instance will always be null.

fromUri

java-static fun fromUri(uri: String!): MediaItem!

Creates a MediaItem for the given URI.

Parameters
uri: String!

The URI.

Returns
MediaItem!

An MediaItem for the given URI.

fromUri

java-static fun fromUri(uri: Uri!): MediaItem!

Creates a MediaItem for the given URI.

Parameters
uri: Uri!

The uri.

Returns
MediaItem!

An MediaItem for the given URI.

hashCode

fun hashCode(): Int

toBundle

@UnstableApi
fun toBundle(): Bundle!

Returns a Bundle representing the information stored in this object.

It omits the localConfiguration field. The localConfiguration of an instance restored from such a bundle by fromBundle will be null.

toBundleIncludeLocalConfiguration

@UnstableApi
fun toBundleIncludeLocalConfiguration(): Bundle!

Returns a Bundle representing the information stored in this MediaItem object, while including the localConfiguration field if it is not null (otherwise skips it).

Public properties

clippingConfiguration

val clippingConfigurationMediaItem.ClippingConfiguration!

The clipping properties.

clippingProperties

@UnstableApi
val clippingPropertiesMediaItem.ClippingProperties!

liveConfiguration

val liveConfigurationMediaItem.LiveConfiguration!

The live playback configuration.

localConfiguration

val localConfigurationMediaItem.LocalConfiguration?

Optional configuration for local playback. May be null if shared over process boundaries.

mediaId

val mediaIdString!

Identifies the media item.

mediaMetadata

val mediaMetadataMediaMetadata!

The media metadata.

playbackProperties

@UnstableApi
val playbackPropertiesMediaItem.LocalConfiguration?

requestMetadata

val requestMetadataMediaItem.RequestMetadata!

The media RequestMetadata.