Back to Exoplayer

ContentMetadata (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/cache/ContentMetadata.html

latest5.9 KB
Original Source

Package com.google.android.exoplayer2.upstream.cache

Interface ContentMetadata

  • All Known Implementing Classes:DefaultContentMetadata

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceContentMetadata

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Interface for an immutable snapshot of keyed metadata.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static String | KEY_CONTENT_LENGTH | Deprecated.

Key for content length in bytes (type: long). | | static String | KEY_CUSTOM_PREFIX | Deprecated.

Prefix for custom metadata keys. | | static String | KEY_REDIRECTED_URI | Deprecated.

Key for redirected uri (type: String). |

Method Summary

All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | boolean | contains​(String key) | Deprecated.

Returns whether the metadata is available. | | byte[] | get​(String key, byte[] defaultValue) | Deprecated.

Returns a metadata value. | | long | get​(String key, long defaultValue) | Deprecated.

Returns a metadata value. | | String | get​(String key, String defaultValue) | Deprecated.

Returns a metadata value. | | static long | getContentLength​(ContentMetadata contentMetadata) | Deprecated.

Returns the value stored under KEY_CONTENT_LENGTH, or C.LENGTH_UNSET if not set. | | static Uri | getRedirectedUri​(ContentMetadata contentMetadata) | Deprecated.

Returns the value stored under KEY_REDIRECTED_URI as a Uri, or {code null} if not set. |

Field Detail

- 

KEY_CUSTOM_PREFIX

static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")KEY_CUSTOM_PREFIX

Deprecated.

Prefix for custom metadata keys. Applications can use keys starting with this prefix without any risk of their keys colliding with ones defined by the ExoPlayer library. See Also:Constant Field Values

- 

KEY_REDIRECTED_URI

static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")KEY_REDIRECTED_URI

Deprecated.

Key for redirected uri (type: String). See Also:Constant Field Values

- 

KEY_CONTENT_LENGTH

static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")KEY_CONTENT_LENGTH

Deprecated.

Key for content length in bytes (type: long). See Also:Constant Field Values

Method Detail

- 

get

@Nullable
byte[] get​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key,
           @Nullable
           byte[] defaultValue)

Deprecated.

Returns a metadata value. Parameters:key - Key of the metadata to be returned.defaultValue - Value to return if the metadata doesn't exist.Returns:The metadata value.

- 

get

@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")get​([String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")key,
           @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")defaultValue)

Deprecated.

Returns a metadata value. Parameters:key - Key of the metadata to be returned.defaultValue - Value to return if the metadata doesn't exist.Returns:The metadata value.

- 

get

long get​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key,
         long defaultValue)

Deprecated.

Returns a metadata value. Parameters:key - Key of the metadata to be returned.defaultValue - Value to return if the metadata doesn't exist.Returns:The metadata value.

- 

contains

boolean contains​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key)

Deprecated.

Returns whether the metadata is available.

- 

getContentLength

static long getContentLength​([ContentMetadata](ContentMetadata.html "interface in com.google.android.exoplayer2.upstream.cache")contentMetadata)

Deprecated.

Returns the value stored under KEY_CONTENT_LENGTH, or C.LENGTH_UNSET if not set.

- 

getRedirectedUri

@Nullable
static[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")getRedirectedUri​([ContentMetadata](ContentMetadata.html "interface in com.google.android.exoplayer2.upstream.cache")contentMetadata)

Deprecated.

Returns the value stored under KEY_REDIRECTED_URI as a Uri, or {code null} if not set.