@UnstableApi
interface ContentMetadata

Known direct subclasses
DefaultContentMetadata

Default implementation of ContentMetadata.


Interface for an immutable snapshot of keyed metadata.

Summary

Constants

const String!
KEY_CONTENT_LENGTH = "exo_len"

Key for content length in bytes (type: long).

const String!
KEY_CUSTOM_PREFIX = "custom_"

Prefix for custom metadata keys.

const String!
KEY_REDIRECTED_URI = "exo_redir"

Key for redirected uri (type: String).

Public functions

Boolean

Returns whether the metadata is available.

ByteArray<Byte>?
get(key: String!, defaultValue: ByteArray?)

Returns a metadata value.

Long
get(key: String!, defaultValue: Long)

Returns a metadata value.

String?
get(key: String!, defaultValue: String?)

Returns a metadata value.

java-static Long
getContentLength(contentMetadata: ContentMetadata!)

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

java-static Uri?
getRedirectedUri(contentMetadata: ContentMetadata!)

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

Constants

KEY_CONTENT_LENGTH

const val KEY_CONTENT_LENGTH = "exo_len": String!

Key for content length in bytes (type: long).

KEY_CUSTOM_PREFIX

const val KEY_CUSTOM_PREFIX = "custom_": String!

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.

KEY_REDIRECTED_URI

const val KEY_REDIRECTED_URI = "exo_redir": String!

Key for redirected uri (type: String).

Public functions

contains

fun contains(key: String!): Boolean

Returns whether the metadata is available.

get

fun get(key: String!, defaultValue: ByteArray?): ByteArray<Byte>?

Returns a metadata value.

Parameters
key: String!

Key of the metadata to be returned.

defaultValue: ByteArray?

Value to return if the metadata doesn't exist.

Returns
ByteArray<Byte>?

The metadata value.

get

fun get(key: String!, defaultValue: Long): Long

Returns a metadata value.

Parameters
key: String!

Key of the metadata to be returned.

defaultValue: Long

Value to return if the metadata doesn't exist.

Returns
Long

The metadata value.

get

fun get(key: String!, defaultValue: String?): String?

Returns a metadata value.

Parameters
key: String!

Key of the metadata to be returned.

defaultValue: String?

Value to return if the metadata doesn't exist.

Returns
String?

The metadata value.

getContentLength

java-static fun getContentLength(contentMetadata: ContentMetadata!): Long

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

getRedirectedUri

java-static fun getRedirectedUri(contentMetadata: ContentMetadata!): Uri?

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