MediaItem
public final class MediaItem
Representation of a media item.
Summary
Nested types |
|---|
public final class MediaItem.AdsConfigurationConfiguration for playing back linear ads with a media item. |
public final class MediaItem.AdsConfiguration.BuilderBuilder for |
public final class MediaItem.BuilderA builder for |
public class MediaItem.ClippingConfigurationOptionally clips the media item to a custom start and end position. |
public final class MediaItem.ClippingConfiguration.BuilderBuilder for |
@UnstableApiThis class is deprecated. Use |
public final class MediaItem.DrmConfigurationDRM configuration for a media item. |
public final class MediaItem.DrmConfiguration.BuilderBuilder for |
public final class MediaItem.LiveConfigurationLive playback configuration. |
public final class MediaItem.LiveConfiguration.BuilderBuilder for |
public final class MediaItem.LocalConfigurationProperties for local playback. |
public final class MediaItem.RequestMetadataMetadata that helps the player to understand a playback request represented by a |
public final class MediaItem.RequestMetadata.BuilderBuilder for |
@UnstableApiThis class is deprecated. Use |
public class MediaItem.SubtitleConfigurationProperties for a text track. |
public final class MediaItem.SubtitleConfiguration.BuilderBuilder for |
Constants |
|
|---|---|
static final String |
DEFAULT_MEDIA_ID = ""The default media ID that is used if the media ID is not explicitly set by |
static final MediaItem |
Empty |
Public fields |
|
|---|---|
final MediaItem.ClippingConfiguration |
The clipping properties. |
final MediaItem.ClippingProperties |
This field is deprecated. Use |
final MediaItem.LiveConfiguration |
The live playback configuration. |
final @Nullable MediaItem.LocalConfiguration |
Optional configuration for local playback. |
final String |
Identifies the media item. |
final MediaMetadata |
The media metadata. |
final @Nullable MediaItem.LocalConfiguration |
This field is deprecated. Use |
final MediaItem.RequestMetadata |
The media |
Public methods |
|
|---|---|
MediaItem.Builder |
Returns a |
boolean |
|
static MediaItem |
@UnstableApiRestores a |
static MediaItem |
Creates a |
static MediaItem |
|
int |
hashCode() |
Bundle |
Returns a |
Bundle |
Returns a |
Constants
DEFAULT_MEDIA_ID
public static final String DEFAULT_MEDIA_ID = ""
The default media ID that is used if the media ID is not explicitly set by setMediaId.
Public fields
clippingConfiguration
public final MediaItem.ClippingConfiguration clippingConfiguration
The clipping properties.
liveConfiguration
public final MediaItem.LiveConfiguration liveConfiguration
The live playback configuration.
localConfiguration
public final @Nullable MediaItem.LocalConfiguration localConfiguration
Optional configuration for local playback. May be null if shared over process boundaries.
playbackProperties
@UnstableApi
public final @Nullable MediaItem.LocalConfiguration playbackProperties
Public methods
buildUpon
public MediaItem.Builder buildUpon()
Returns a Builder initialized with the values of this instance.
fromBundle
@UnstableApi
public static MediaItem fromBundle(Bundle bundle)
Restores a MediaItem from a Bundle.
The localConfiguration of a restored instance will always be null.
fromUri
public static MediaItem fromUri(String uri)
Creates a MediaItem for the given URI.
| Parameters | |
|---|---|
String uri |
The URI. |
toBundle
@UnstableApi
public Bundle toBundle()
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
public Bundle toBundleIncludeLocalConfiguration()
Returns a Bundle representing the information stored in this MediaItem object, while including the localConfiguration field if it is not null (otherwise skips it).