public final class C


Defines constants used by the library.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.AudioAllowedCapturePolicy

Capture policies for audio attributes.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.AudioContentType

Content types for audio attributes.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(flag = true, value = )
public annotation C.AudioFlags

Flags for audio attributes.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.AudioUsage

Usage types for audio attributes.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.AuxiliaryTrackType

Auxiliary track types.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(flag = true, value = )
public annotation C.BufferFlags

Flags which can apply to a buffer containing a media sample.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = [Format.NO_VALUE])
public annotation C.ColorRange

Video color range.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = [Format.NO_VALUE])
public annotation C.ColorSpace

Video color spaces, also referred to as color standards.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = [Format.NO_VALUE])
public annotation C.ColorTransfer

Video/image color transfer characteristics.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.ContentType

Represents a streaming or other media type.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
@UnstableApi
public annotation C.CryptoMode

Crypto modes for a codec.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(open = true, value = )
public annotation C.CryptoType

Types of crypto implementation.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(open = true, value = )
public annotation C.DataType

Represents a type of data.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = [Format.NO_VALUE])
public annotation C.Encoding

Represents an audio encoding, or an invalid or unset value.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@UnstableApi
@IntDef(value = )
public annotation C.FirstFrameState

State of the first frame in a video renderer.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.FormatSupport

Level of support for a format.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.NetworkType

Network connection type.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = [Format.NO_VALUE])
public annotation C.PcmEncoding

Represents a PCM audio encoding, or an invalid or unset value.

@Documented
@UnstableApi
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(open = true, value = )
public annotation C.Priority

A value indicating the priority of a operation.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = [Format.NO_VALUE])
public annotation C.Projection

Video projection types.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(flag = true, value = )
public annotation C.RoleFlags

Track role flags.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(flag = true, value = )
public annotation C.SelectionFlags

Track selection flags.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(open = true, value = )
public annotation C.SelectionReason

Represents a reason for selection.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
public annotation C.SpatializationBehavior

Represents the behavior affecting whether spatialization will be used.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = [Format.NO_VALUE])
public annotation C.StereoMode

The stereo mode for 360/3D/VR videos.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.StreamType

Stream types for an android.media.AudioTrack.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(open = true, value = )
public annotation C.TrackType

Represents a type of media track.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.VideoChangeFrameRateStrategy

Strategies for calling setFrameRate.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
public annotation C.VideoOutputMode

Video decoder output modes.

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.VideoScalingMode

Video scaling modes for MediaCodec-based renderers.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(flag = true, value = )
public annotation C.VolumeFlags

Volume flags to be used when setting or adjusting device volume.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation C.WakeMode

Mode specifying whether the player should hold a WakeLock and a WifiLock.

Constants

static final int

See ALLOW_CAPTURE_BY_ALL.

static final int

See ALLOW_CAPTURE_BY_NONE.

static final int

See ALLOW_CAPTURE_BY_SYSTEM.

static final int

See CONTENT_TYPE_MOVIE.

static final int

See CONTENT_TYPE_MUSIC.

static final int

See CONTENT_TYPE_SONIFICATION.

static final int

See CONTENT_TYPE_SPEECH.

static final int

See CONTENT_TYPE_UNKNOWN.

static final int

Represents an unset android.media.AudioTrack session identifier.

static final int

An inverse encoded depth video track.

static final int

A linear encoded depth video track.

static final int

A timed metadata of depth video track.

static final int

The original video track without any depth based effects applied.

static final int

Not an auxiliary track or an auxiliary track with an undefined type.

static final int

The number of bits per byte.

static final int

Indicates that a buffer is (at least partially) encrypted.

static final int

Flag for empty buffers that signal that the end of the stream was reached.

static final int

Indicates that a buffer is known to contain the first media sample of the stream.

static final int

Indicates that a buffer has supplemental data.

static final int

Indicates that a buffer holds a synchronization sample.

static final int

Indicates that a buffer is known to contain the last media sample of the stream.

static final int

Indicates that no other buffers depend on the data in this buffer.

static final int

The number of bytes per float.

static final String

"cbc1" scheme type name as defined in ISO/IEC 23001-7:2016.

static final String

"cbcs" scheme type name as defined in ISO/IEC 23001-7:2016.

static final String

"cenc" scheme type name as defined in ISO/IEC 23001-7:2016.

static final String

"cens" scheme type name as defined in ISO/IEC 23001-7:2016.

static final UUID

UUID for the ClearKey DRM scheme.

static final int

See COLOR_RANGE_FULL.

static final int

See COLOR_RANGE_LIMITED.

static final int

See COLOR_STANDARD_BT2020.

static final int

See COLOR_STANDARD_BT601_PAL.

static final int

See COLOR_STANDARD_BT709.

static final int

See TRANSFER_GAMMA2_2.

static final int

See COLOR_TRANSFER_HLG.

static final int

See COLOR_TRANSFER_LINEAR.

static final int

See COLOR_TRANSFER_SDR_VIDEO.

static final int

See TRANSFER_SRGB.

static final int

See COLOR_TRANSFER_ST2084.

static final UUID

UUID for the W3C Common PSSH box.

static final int

Value representing a DASH manifest.

static final int

Value representing an HLS manifest.

static final int

This field is deprecated.

Use AUDIO_CONTENT_TYPE_MOVIE instead.

static final int

This field is deprecated.

Use AUDIO_CONTENT_TYPE_MUSIC instead.

static final int

Value representing files other than DASH, HLS or Smooth Streaming manifests, or RTSP URIs.

static final int

Value representing an RTSP stream.

static final int

This field is deprecated.

Use AUDIO_CONTENT_TYPE_SONIFICATION instead.

static final int

This field is deprecated.

Use AUDIO_CONTENT_TYPE_SPEECH instead.

static final int

Value representing a Smooth Streaming manifest.

static final int

This field is deprecated.

Use AUDIO_CONTENT_TYPE_UNKNOWN instead.

static final int

See CRYPTO_MODE_AES_CBC.

static final int

See CRYPTO_MODE_AES_CTR.

static final int

See CRYPTO_MODE_UNENCRYPTED.

static final int

Applications or extensions may define custom CRYPTO_TYPE_* constants greater than or equal to this value.

static final int

Framework crypto in which a MediaCodec is configured with a MediaCrypto.

static final int

No crypto.

static final int

An unsupported crypto type.

static final int

A data type constant for ads loader data.

static final int

Applications or extensions may define custom DATA_TYPE_* constants greater than or equal to this value.

static final int

A data type constant for drm or encryption data.

static final int

A data type constant for a manifest file.

static final int

A data type constant for media, typically containing media samples.

static final int

A data type constant for media, typically containing only initialization data.

static final int

A data type constant for live progressive media streams, typically containing media samples.

static final int

A data type constant for time synchronization data.

static final int

A data type constant for data of unknown or unspecified type.

static final int

A default size in bytes for an individual allocation that forms part of a larger buffer.

static final long

A default maximum position for which a seek to previous will seek to the previous window, in milliseconds.

static final long

A default seek back increment, in milliseconds.

static final long

A default seek forward increment, in milliseconds.

static final int

See ENCODING_AAC_ELD.

static final int

AAC Error Resilient Bit-Sliced Arithmetic Coding.

static final int

See ENCODING_AAC_HE_V1.

static final int

See ENCODING_AAC_HE_V2.

static final int

See ENCODING_AAC_LC.

static final int

See ENCODING_AAC_XHE.

static final int

See ENCODING_AC3.

static final int

See ENCODING_AC4.

static final int

See ENCODING_DOLBY_TRUEHD.

static final int

See ENCODING_DTS.

static final int

See ENCODING_DTS_HD.

static final int

See ENCODING_DTS_UHD_P2.

static final int

See ENCODING_E_AC3.

static final int

See ENCODING_E_AC3_JOC.

static final int

See ENCODING_INVALID.

static final int

See ENCODING_MP3.

static final int

See ENCODING_OPUS.

static final int

See ENCODING_PCM_16BIT.

static final int

Like ENCODING_PCM_16BIT, but with the bytes in big endian order.

static final int

PCM encoding with 24 bits per sample.

static final int

Like ENCODING_PCM_24BIT but with the bytes in big endian order.

static final int

PCM encoding with 32 bits per sample.

static final int

Like ENCODING_PCM_32BIT but with the bytes in big endian order.

static final int

See ENCODING_PCM_8BIT.

static final int

See ENCODING_PCM_FLOAT.

static final int

The first frame was not rendered after the last reset, output surface or stream change.

static final int

The first frame was not rendered after the last stream change.

static final int

The first frame was not rendered yet, and is only allowed to be rendered if the renderer is started.

static final int

The first frame was rendered.

static final int

See FLAG_AUDIBILITY_ENFORCED.

static final int

Formats with the same MIME type are supported, but the properties of this format exceed the declared capabilities.

static final int

The format is supported.

static final int

Formats with the same MIME type are supported, but this format's DRM protection is not supported.

static final int

Formats with the same top-level type are generally supported, but not this format or any other format with the same MIME type because the sub-type is not supported.

static final int

The format is unsupported, because no formats with the same top-level type are supported or there is only specialized support for different MIME types of the same top-level type.

static final int

Represents an unset or unknown index or byte position.

static final String

Represents an undetermined language as an ISO 639-2 language code.

static final int

Represents an unset or unknown length.

static final int

A non-realtime (as fast as possible) codec priority.

static final int

A realtime codec priority.

static final long

The number of microseconds in one second.

static final long

The number of milliseconds in one second.

static final long

The number of nanoseconds in one second.

static final int

Network type for a 2G cellular connection.

static final int

Network type for a 3G cellular connection.

static final int

Network type for a 4G cellular connection.

static final int

Network type for a 5G non-stand-alone (NSA) cellular connection.

static final int

Network type for a 5G stand-alone (SA) cellular connection.

static final int

Network type for cellular connections which cannot be mapped to one of NETWORK_TYPE_2G, NETWORK_TYPE_3G, or NETWORK_TYPE_4G.

static final int

Network type for an Ethernet connection.

static final int

No network connection.

static final int

Network type for other connections which are not Wifi or cellular (e.g. VPN, Bluetooth).

static final int

Unknown network type.

static final int

Network type for a Wifi connection.

static final int

Represents an unset or unknown percentage.

static final UUID

UUID for the PlayReady DRM scheme.

static final int

This field is deprecated.

Use INDEX_UNSET.

static final int

Priority for media downloading unrelated to active playback.

static final int

The maximum supported Priority.

static final int

Priority for active media playback.

static final int

Priority for preloading media playback resources before the playback becomes active.

static final int

Priority for processing media in the background (for example, when the user is not waiting for the processing to complete).

static final int

Priority for processing media in the foreground (for example, while the user is waiting for the processing to complete).

static final int

Cube map projection.

static final int

Equirectangular spherical projection.

static final int

3-D mesh projection.

static final int

Conventional rectangular projection.

static final float
RATE_UNSET = -3.4028235E38f

Represents an unset or unknown rate.

static final int

Represents an unset or unknown integer rate.

static final int

A return value for methods where a buffer was read.

static final int

A return value for methods where the end of an input was encountered.

static final int

A return value for methods where a format was read.

static final int

A return value for methods where the length of parsed data exceeds the maximum length allowed.

static final int

A return value for methods where nothing was read.

static final int

Indicates an alternate track.

static final int

Indicates an auxiliary track.

static final int

Indicates the track contains captions.

static final int

Indicates the track contains commentary, for example from the director.

static final int

Indicates the track contains a textual description of music and sound.

static final int

Indicates the track contains an audio or textual description of a video track.

static final int

Indicates the track is in a different language from the original, for example dubbed audio or translated captions.

static final int

Indicates the track contains a text that has been edited for ease of reading.

static final int

Indicates the track contains information about a current emergency.

static final int

Indicates the track is designed for improved intelligibility of dialogue.

static final int

Indicates a main track.

static final int

Indicates the track contains a visual sign-language interpretation of an audio track.

static final int

Indicates the track contains subtitles.

static final int

Indicates a supplementary track, meaning the track has lower importance than the main track(s).

static final int

Indicates the track contains a transcription of spoken dialog.

static final int

Indicates the track is intended for trick play.

static final String

The name of the sans-serif font family.

static final int

Indicates that the player may choose to play the track in absence of an explicit user preference.

static final int

Indicates that the track should be selected if user preferences do not state otherwise.

static final int

Indicates that the track should be selected if its language matches the language of the selected audio track and user preferences do not state otherwise.

static final int

A selection reason constant for an adaptive track selection.

static final int

Applications or extensions may define custom SELECTION_REASON_* constants greater than or equal to this value.

static final int

A selection reason constant for an initial track selection.

static final int

A selection reason constant for an manual (i.e. user initiated) track selection.

static final int

A selection reason constant for a trick play track selection.

static final int

A selection reason constant for selections whose reasons are unknown or unspecified.

static final String

The name of the serif font family.

static final int

See SPATIALIZATION_BEHAVIOR_AUTO.

static final int

See SPATIALIZATION_BEHAVIOR_NEVER.

static final String

The URI scheme used for content with server side ad insertion.

static final int

Indicates interleaved stereo layout with the left view being the primary view, used with 360/3D/VR videos.

static final int

Indicates interleaved stereo layout with the right view being the primary view, used with 360/3D/VR videos.

static final int

Indicates Left-Right stereo layout, used with 360/3D/VR videos.

static final int

Indicates Monoscopic stereo layout, used with 360/3D/VR videos.

static final int

Indicates a stereo layout where the left and right eyes have separate meshes, used with 360/3D/VR videos.

static final int

Indicates Top-Bottom stereo layout, used with 360/3D/VR videos.

static final int

See STREAM_ALARM.

static final int

The default stream type used by audio renderers.

static final int

See STREAM_DTMF.

static final int

See STREAM_MUSIC.

static final int

See STREAM_NOTIFICATION.

static final int

See STREAM_RING.

static final int

See STREAM_SYSTEM.

static final int

See STREAM_VOICE_CALL.

static final long
TIME_END_OF_SOURCE = -9223372036854775808

Special constant representing a time corresponding to the end of a source.

static final long
TIME_UNSET = -9223372036854775807

Special constant representing an unset or unknown time or duration.

static final int

A type constant for audio tracks.

static final int

A type constant for camera motion tracks.

static final int

Applications or extensions may define custom TRACK_TYPE_* constants greater than or equal to this value.

static final int

A type constant for tracks of some default type, where the type itself is unknown.

static final int

A type constant for image tracks.

static final int

A type constant for metadata tracks.

static final int

A type constant for a fake or empty track.

static final int

A type constant for text tracks.

static final int

A type constant for tracks of unknown type.

static final int

A type constant for video tracks.

static final int

This field is deprecated.

Use CONTENT_TYPE_DASH instead.

static final int

This field is deprecated.

Use CONTENT_TYPE_HLS instead.

static final int

This field is deprecated.

Use CONTENT_TYPE_OTHER instead.

static final int

This field is deprecated.

Use CONTENT_TYPE_RTSP instead.

static final int

This field is deprecated.

Use CONTENT_TYPE_SS instead.

static final int

See USAGE_ALARM.

static final int

See USAGE_ASSISTANCE_ACCESSIBILITY.

static final int

See USAGE_ASSISTANCE_NAVIGATION_GUIDANCE.

static final int

See USAGE_ASSISTANCE_SONIFICATION.

static final int

See USAGE_ASSISTANT.

static final int

See USAGE_GAME.

static final int

See USAGE_MEDIA.

static final int

See USAGE_NOTIFICATION.

static final int

See USAGE_NOTIFICATION_COMMUNICATION_DELAYED.

static final int

See USAGE_NOTIFICATION_COMMUNICATION_INSTANT.

static final int

See USAGE_NOTIFICATION_COMMUNICATION_REQUEST.

static final int

See USAGE_NOTIFICATION_EVENT.

static final int

See USAGE_NOTIFICATION_RINGTONE.

static final int

See USAGE_UNKNOWN.

static final int

See USAGE_VOICE_COMMUNICATION.

static final int

See USAGE_VOICE_COMMUNICATION_SIGNALLING.

static final UUID

The Nil UUID as defined by RFC4122.

static final int

Strategy to never call setFrameRate.

static final int

Strategy to call setFrameRate with CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS when the output frame rate is known.

static final int

Video decoder output mode is not set.

static final int

Video decoder output mode that renders 4:2:0 YUV planes directly to a surface.

static final int

Video decoder output mode that outputs raw 4:2:0 YUV planes.

static final int

A default video scaling mode for MediaCodec-based renderers.

static final int

See VIDEO_SCALING_MODE_SCALE_TO_FIT.

static final int

See VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING.

static final int

See FLAG_ALLOW_RINGER_MODES.

static final int

See FLAG_PLAY_SOUND.

static final int

See FLAG_REMOVE_SOUND_AND_VIBRATE.

static final int

See FLAG_SHOW_UI.

static final int

See FLAG_VIBRATE.

static final int

A wake mode that will cause the player to hold a android.os.PowerManager.WakeLock during playback.

static final int

A wake mode that will cause the player to hold a android.os.PowerManager.WakeLock and a android.net.wifi.WifiManager.WifiLock during playback.

static final int

A wake mode that will not cause the player to hold any locks.

static final UUID

UUID for the Widevine DRM scheme.

Public methods

static int
@UnstableApi
@InlineMe(replacement = "Util.generateAudioSessionIdV21(context)", imports = [""androidx.media3.common.util.Util""])
generateAudioSessionIdV21(Context context)

This method is deprecated.

Use generateAudioSessionIdV21.

static int
@UnstableApi
@InlineMe(replacement = "Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode)", imports = [""androidx.media3.common.util.Util""])
@PlaybackException.ErrorCode
getErrorCodeForMediaDrmErrorCode(int mediaDrmErrorCode)

This method is deprecated.

Use getErrorCodeForMediaDrmErrorCode.

static String
@UnstableApi
@InlineMe(replacement = "Util.getFormatSupportString(formatSupport)", imports = [""androidx.media3.common.util.Util""])
getFormatSupportString(@C.FormatSupport int formatSupport)

This method is deprecated.

Use getFormatSupportString.

static long
@UnstableApi
@InlineMe(replacement = "Util.msToUs(timeMs)", imports = [""androidx.media3.common.util.Util""])
msToUs(long timeMs)

This method is deprecated.

Use msToUs.

static long
@UnstableApi
@InlineMe(replacement = "Util.usToMs(timeUs)", imports = [""androidx.media3.common.util.Util""])
usToMs(long timeUs)

This method is deprecated.

Use usToMs.

Constants

ALLOW_CAPTURE_BY_ALL

public static final int ALLOW_CAPTURE_BY_ALL = 1

See ALLOW_CAPTURE_BY_ALL.

ALLOW_CAPTURE_BY_NONE

public static final int ALLOW_CAPTURE_BY_NONE = 3

See ALLOW_CAPTURE_BY_NONE.

ALLOW_CAPTURE_BY_SYSTEM

public static final int ALLOW_CAPTURE_BY_SYSTEM = 2

See ALLOW_CAPTURE_BY_SYSTEM.

AUDIO_CONTENT_TYPE_MOVIE

public static final int AUDIO_CONTENT_TYPE_MOVIE = 3

See CONTENT_TYPE_MOVIE.

AUDIO_CONTENT_TYPE_MUSIC

public static final int AUDIO_CONTENT_TYPE_MUSIC = 2

See CONTENT_TYPE_MUSIC.

AUDIO_CONTENT_TYPE_SONIFICATION

public static final int AUDIO_CONTENT_TYPE_SONIFICATION = 4

See CONTENT_TYPE_SONIFICATION.

AUDIO_CONTENT_TYPE_SPEECH

public static final int AUDIO_CONTENT_TYPE_SPEECH = 1

See CONTENT_TYPE_SPEECH.

AUDIO_CONTENT_TYPE_UNKNOWN

public static final int AUDIO_CONTENT_TYPE_UNKNOWN = 0

See CONTENT_TYPE_UNKNOWN.

AUDIO_SESSION_ID_UNSET

@UnstableApi
public static final int AUDIO_SESSION_ID_UNSET = 0

Represents an unset android.media.AudioTrack session identifier. Equal to AUDIO_SESSION_ID_GENERATE.

AUXILIARY_TRACK_TYPE_DEPTH_INVERSE

@UnstableApi
public static final int AUXILIARY_TRACK_TYPE_DEPTH_INVERSE = 3

An inverse encoded depth video track.

See https://developer.android.com/static/media/camera/camera2/Dynamic-depth-v1.0.pdf for inverse depth encoding.

AUXILIARY_TRACK_TYPE_DEPTH_LINEAR

@UnstableApi
public static final int AUXILIARY_TRACK_TYPE_DEPTH_LINEAR = 2

A linear encoded depth video track.

See https://developer.android.com/static/media/camera/camera2/Dynamic-depth-v1.0.pdf for linear depth encoding.

AUXILIARY_TRACK_TYPE_DEPTH_METADATA

@UnstableApi
public static final int AUXILIARY_TRACK_TYPE_DEPTH_METADATA = 4

A timed metadata of depth video track.

AUXILIARY_TRACK_TYPE_ORIGINAL

@UnstableApi
public static final int AUXILIARY_TRACK_TYPE_ORIGINAL = 1

The original video track without any depth based effects applied.

AUXILIARY_TRACK_TYPE_UNDEFINED

@UnstableApi
public static final int AUXILIARY_TRACK_TYPE_UNDEFINED = 0

Not an auxiliary track or an auxiliary track with an undefined type.

BITS_PER_BYTE

@UnstableApi
public static final int BITS_PER_BYTE = 8

The number of bits per byte.

BUFFER_FLAG_ENCRYPTED

@UnstableApi
public static final int BUFFER_FLAG_ENCRYPTED = 1073741824

Indicates that a buffer is (at least partially) encrypted.

BUFFER_FLAG_END_OF_STREAM

@UnstableApi
public static final int BUFFER_FLAG_END_OF_STREAM = 4

Flag for empty buffers that signal that the end of the stream was reached.

BUFFER_FLAG_FIRST_SAMPLE

@UnstableApi
public static final int BUFFER_FLAG_FIRST_SAMPLE = 134217728

Indicates that a buffer is known to contain the first media sample of the stream.

BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA

@UnstableApi
public static final int BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA = 268435456

Indicates that a buffer has supplemental data.

BUFFER_FLAG_KEY_FRAME

@UnstableApi
public static final int BUFFER_FLAG_KEY_FRAME = 1

Indicates that a buffer holds a synchronization sample.

BUFFER_FLAG_LAST_SAMPLE

@UnstableApi
public static final int BUFFER_FLAG_LAST_SAMPLE = 536870912

Indicates that a buffer is known to contain the last media sample of the stream.

BUFFER_FLAG_NOT_DEPENDED_ON

@UnstableApi
public static final int BUFFER_FLAG_NOT_DEPENDED_ON = 67108864

Indicates that no other buffers depend on the data in this buffer.

BYTES_PER_FLOAT

@UnstableApi
public static final int BYTES_PER_FLOAT = 4

The number of bytes per float.

CENC_TYPE_cbc1

@UnstableApi
public static final String CENC_TYPE_cbc1 = "cbc1"

"cbc1" scheme type name as defined in ISO/IEC 23001-7:2016.

CENC_TYPE_cbcs

@UnstableApi
public static final String CENC_TYPE_cbcs = "cbcs"

"cbcs" scheme type name as defined in ISO/IEC 23001-7:2016.

CENC_TYPE_cenc

@UnstableApi
public static final String CENC_TYPE_cenc = "cenc"

"cenc" scheme type name as defined in ISO/IEC 23001-7:2016.

CENC_TYPE_cens

@UnstableApi
public static final String CENC_TYPE_cens = "cens"

"cens" scheme type name as defined in ISO/IEC 23001-7:2016.

CLEARKEY_UUID

public static final UUID CLEARKEY_UUID

UUID for the ClearKey DRM scheme.

ClearKey is supported on Android devices running Android 5.0 (API Level 21) and up.

COLOR_RANGE_FULL

@UnstableApi
public static final int COLOR_RANGE_FULL = 1

See COLOR_RANGE_FULL.

COLOR_RANGE_LIMITED

@UnstableApi
public static final int COLOR_RANGE_LIMITED = 2

See COLOR_RANGE_LIMITED.

COLOR_SPACE_BT2020

@UnstableApi
public static final int COLOR_SPACE_BT2020 = 6

See COLOR_STANDARD_BT2020.

COLOR_SPACE_BT601

@UnstableApi
public static final int COLOR_SPACE_BT601 = 2

See COLOR_STANDARD_BT601_PAL.

COLOR_SPACE_BT709

@UnstableApi
public static final int COLOR_SPACE_BT709 = 1

See COLOR_STANDARD_BT709.

COLOR_TRANSFER_GAMMA_2_2

@UnstableApi
public static final int COLOR_TRANSFER_GAMMA_2_2 = 10

See TRANSFER_GAMMA2_2. The Gamma 2.2 transfer function, used for some SDR use-cases like tone-mapping.

COLOR_TRANSFER_HLG

@UnstableApi
public static final int COLOR_TRANSFER_HLG = 7

See COLOR_TRANSFER_HLG.

COLOR_TRANSFER_LINEAR

@UnstableApi
public static final int COLOR_TRANSFER_LINEAR = 1

See COLOR_TRANSFER_LINEAR.

COLOR_TRANSFER_SDR

@UnstableApi
public static final int COLOR_TRANSFER_SDR = 3

See COLOR_TRANSFER_SDR_VIDEO. The SMPTE 170M transfer function.

COLOR_TRANSFER_SRGB

@UnstableApi
public static final int COLOR_TRANSFER_SRGB = 2

See TRANSFER_SRGB. The standard RGB transfer function, used for some SDR use-cases like image input.

COLOR_TRANSFER_ST2084

@UnstableApi
public static final int COLOR_TRANSFER_ST2084 = 6

See COLOR_TRANSFER_ST2084.

COMMON_PSSH_UUID

public static final UUID COMMON_PSSH_UUID

UUID for the W3C Common PSSH box.

CONTENT_TYPE_DASH

public static final int CONTENT_TYPE_DASH = 0

Value representing a DASH manifest.

CONTENT_TYPE_HLS

public static final int CONTENT_TYPE_HLS = 2

Value representing an HLS manifest.

CONTENT_TYPE_MOVIE

@UnstableApi
public static final int CONTENT_TYPE_MOVIE = 3

CONTENT_TYPE_MUSIC

@UnstableApi
public static final int CONTENT_TYPE_MUSIC = 2

CONTENT_TYPE_OTHER

public static final int CONTENT_TYPE_OTHER = 4

Value representing files other than DASH, HLS or Smooth Streaming manifests, or RTSP URIs.

CONTENT_TYPE_RTSP

public static final int CONTENT_TYPE_RTSP = 3

Value representing an RTSP stream.

CONTENT_TYPE_SONIFICATION

@UnstableApi
public static final int CONTENT_TYPE_SONIFICATION = 4

CONTENT_TYPE_SPEECH

@UnstableApi
public static final int CONTENT_TYPE_SPEECH = 1

CONTENT_TYPE_SS

public static final int CONTENT_TYPE_SS = 1

Value representing a Smooth Streaming manifest.

CONTENT_TYPE_UNKNOWN

@UnstableApi
public static final int CONTENT_TYPE_UNKNOWN = 0

CRYPTO_MODE_AES_CBC

@UnstableApi
public static final int CRYPTO_MODE_AES_CBC = 2

See CRYPTO_MODE_AES_CBC.

CRYPTO_MODE_AES_CTR

@UnstableApi
public static final int CRYPTO_MODE_AES_CTR = 1

See CRYPTO_MODE_AES_CTR.

CRYPTO_MODE_UNENCRYPTED

@UnstableApi
public static final int CRYPTO_MODE_UNENCRYPTED = 0

See CRYPTO_MODE_UNENCRYPTED.

CRYPTO_TYPE_CUSTOM_BASE

public static final int CRYPTO_TYPE_CUSTOM_BASE = 10000

Applications or extensions may define custom CRYPTO_TYPE_* constants greater than or equal to this value.

CRYPTO_TYPE_FRAMEWORK

public static final int CRYPTO_TYPE_FRAMEWORK = 2

Framework crypto in which a MediaCodec is configured with a MediaCrypto.

CRYPTO_TYPE_NONE

public static final int CRYPTO_TYPE_NONE = 0

No crypto.

CRYPTO_TYPE_UNSUPPORTED

public static final int CRYPTO_TYPE_UNSUPPORTED = 1

An unsupported crypto type.

DATA_TYPE_AD

@UnstableApi
public static final int DATA_TYPE_AD = 6

A data type constant for ads loader data.

DATA_TYPE_CUSTOM_BASE

@UnstableApi
public static final int DATA_TYPE_CUSTOM_BASE = 10000

Applications or extensions may define custom DATA_TYPE_* constants greater than or equal to this value.

DATA_TYPE_DRM

@UnstableApi
public static final int DATA_TYPE_DRM = 3

A data type constant for drm or encryption data.

DATA_TYPE_MANIFEST

@UnstableApi
public static final int DATA_TYPE_MANIFEST = 4

A data type constant for a manifest file.

DATA_TYPE_MEDIA

@UnstableApi
public static final int DATA_TYPE_MEDIA = 1

A data type constant for media, typically containing media samples.

DATA_TYPE_MEDIA_INITIALIZATION

@UnstableApi
public static final int DATA_TYPE_MEDIA_INITIALIZATION = 2

A data type constant for media, typically containing only initialization data.

DATA_TYPE_MEDIA_PROGRESSIVE_LIVE

@UnstableApi
public static final int DATA_TYPE_MEDIA_PROGRESSIVE_LIVE = 7

A data type constant for live progressive media streams, typically containing media samples.

DATA_TYPE_TIME_SYNCHRONIZATION

@UnstableApi
public static final int DATA_TYPE_TIME_SYNCHRONIZATION = 5

A data type constant for time synchronization data.

DATA_TYPE_UNKNOWN

@UnstableApi
public static final int DATA_TYPE_UNKNOWN = 0

A data type constant for data of unknown or unspecified type.

DEFAULT_BUFFER_SEGMENT_SIZE

@UnstableApi
public static final int DEFAULT_BUFFER_SEGMENT_SIZE = 65536

A default size in bytes for an individual allocation that forms part of a larger buffer.

DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS

public static final long DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS = 3000

A default maximum position for which a seek to previous will seek to the previous window, in milliseconds.

DEFAULT_SEEK_BACK_INCREMENT_MS

public static final long DEFAULT_SEEK_BACK_INCREMENT_MS = 5000

A default seek back increment, in milliseconds.

DEFAULT_SEEK_FORWARD_INCREMENT_MS

public static final long DEFAULT_SEEK_FORWARD_INCREMENT_MS = 15000

A default seek forward increment, in milliseconds.

ENCODING_AAC_ELD

@UnstableApi
public static final int ENCODING_AAC_ELD = 15

See ENCODING_AAC_ELD.

ENCODING_AAC_ER_BSAC

@UnstableApi
public static final int ENCODING_AAC_ER_BSAC = 1073741824

AAC Error Resilient Bit-Sliced Arithmetic Coding.

ENCODING_AAC_HE_V1

@UnstableApi
public static final int ENCODING_AAC_HE_V1 = 11

See ENCODING_AAC_HE_V1.

ENCODING_AAC_HE_V2

@UnstableApi
public static final int ENCODING_AAC_HE_V2 = 12

See ENCODING_AAC_HE_V2.

ENCODING_AAC_LC

@UnstableApi
public static final int ENCODING_AAC_LC = 10

See ENCODING_AAC_LC.

ENCODING_AAC_XHE

@UnstableApi
public static final int ENCODING_AAC_XHE = 16

See ENCODING_AAC_XHE.

ENCODING_AC3

@UnstableApi
public static final int ENCODING_AC3 = 5

See ENCODING_AC3.

ENCODING_AC4

@UnstableApi
public static final int ENCODING_AC4 = 17

See ENCODING_AC4.

ENCODING_DOLBY_TRUEHD

@UnstableApi
public static final int ENCODING_DOLBY_TRUEHD = 14

See ENCODING_DOLBY_TRUEHD.

ENCODING_DTS

@UnstableApi
public static final int ENCODING_DTS = 7

See ENCODING_DTS.

ENCODING_DTS_HD

@UnstableApi
public static final int ENCODING_DTS_HD = 8

See ENCODING_DTS_HD.

ENCODING_DTS_UHD_P2

@UnstableApi
public static final int ENCODING_DTS_UHD_P2 = 30

See ENCODING_DTS_UHD_P2.

ENCODING_E_AC3

@UnstableApi
public static final int ENCODING_E_AC3 = 6

See ENCODING_E_AC3.

ENCODING_E_AC3_JOC

@UnstableApi
public static final int ENCODING_E_AC3_JOC = 18

See ENCODING_E_AC3_JOC.

ENCODING_INVALID

@UnstableApi
public static final int ENCODING_INVALID = 0

See ENCODING_INVALID.

ENCODING_MP3

@UnstableApi
public static final int ENCODING_MP3 = 9

See ENCODING_MP3.

ENCODING_OPUS

@UnstableApi
public static final int ENCODING_OPUS = 20

See ENCODING_OPUS.

ENCODING_PCM_16BIT

@UnstableApi
public static final int ENCODING_PCM_16BIT = 2

See ENCODING_PCM_16BIT.

ENCODING_PCM_16BIT_BIG_ENDIAN

@UnstableApi
public static final int ENCODING_PCM_16BIT_BIG_ENDIAN = 268435456

Like ENCODING_PCM_16BIT, but with the bytes in big endian order.

ENCODING_PCM_24BIT

@UnstableApi
public static final int ENCODING_PCM_24BIT = 21

PCM encoding with 24 bits per sample.

ENCODING_PCM_24BIT_BIG_ENDIAN

@UnstableApi
public static final int ENCODING_PCM_24BIT_BIG_ENDIAN = 1342177280

Like ENCODING_PCM_24BIT but with the bytes in big endian order.

ENCODING_PCM_32BIT

@UnstableApi
public static final int ENCODING_PCM_32BIT = 22

PCM encoding with 32 bits per sample.

ENCODING_PCM_32BIT_BIG_ENDIAN

@UnstableApi
public static final int ENCODING_PCM_32BIT_BIG_ENDIAN = 1610612736

Like ENCODING_PCM_32BIT but with the bytes in big endian order.

ENCODING_PCM_8BIT

@UnstableApi
public static final int ENCODING_PCM_8BIT = 3

See ENCODING_PCM_8BIT.

ENCODING_PCM_FLOAT

@UnstableApi
public static final int ENCODING_PCM_FLOAT = 4

See ENCODING_PCM_FLOAT.

FIRST_FRAME_NOT_RENDERED

@UnstableApi
public static final int FIRST_FRAME_NOT_RENDERED = 1

The first frame was not rendered after the last reset, output surface or stream change.

FIRST_FRAME_NOT_RENDERED_AFTER_STREAM_CHANGE

@UnstableApi
public static final int FIRST_FRAME_NOT_RENDERED_AFTER_STREAM_CHANGE = 2

The first frame was not rendered after the last stream change.

FIRST_FRAME_NOT_RENDERED_ONLY_ALLOWED_IF_STARTED

@UnstableApi
public static final int FIRST_FRAME_NOT_RENDERED_ONLY_ALLOWED_IF_STARTED = 0

The first frame was not rendered yet, and is only allowed to be rendered if the renderer is started.

FIRST_FRAME_RENDERED

@UnstableApi
public static final int FIRST_FRAME_RENDERED = 3

The first frame was rendered.

FLAG_AUDIBILITY_ENFORCED

public static final int FLAG_AUDIBILITY_ENFORCED = 1

See FLAG_AUDIBILITY_ENFORCED.

FORMAT_EXCEEDS_CAPABILITIES

@UnstableApi
public static final int FORMAT_EXCEEDS_CAPABILITIES = 3

Formats with the same MIME type are supported, but the properties of this format exceed the declared capabilities. There is a chance playback with this format is still possible in practice because some components report their capabilities conservatively, but the expected outcome is that playback will fail.

Example: A player is capable of rendering H264 and the format's MIME type is MimeTypes#VIDEO_H264, but the format's resolution exceeds the maximum limit supported by the underlying H264 decoder.

FORMAT_HANDLED

@UnstableApi
public static final int FORMAT_HANDLED = 4

The format is supported.

FORMAT_UNSUPPORTED_DRM

@UnstableApi
public static final int FORMAT_UNSUPPORTED_DRM = 2

Formats with the same MIME type are supported, but this format's DRM protection is not supported.

Example: The player is capable of rendering H264 and the format's MIME type is VIDEO_H264, but the format indicates PlayReady DRM protection whereas the renderer only supports Widevine.

FORMAT_UNSUPPORTED_SUBTYPE

@UnstableApi
public static final int FORMAT_UNSUPPORTED_SUBTYPE = 1

Formats with the same top-level type are generally supported, but not this format or any other format with the same MIME type because the sub-type is not supported.

Example: The player supports audio and the format's MIME type matches audio/[subtype], but there does not exist a suitable decoder for [subtype].

FORMAT_UNSUPPORTED_TYPE

@UnstableApi
public static final int FORMAT_UNSUPPORTED_TYPE = 0

The format is unsupported, because no formats with the same top-level type are supported or there is only specialized support for different MIME types of the same top-level type.

Example 1: The player is a general purpose audio player, but the format has a video MIME type.

Example 2: The player only has specialized support for AV1 and no general purpose video support, but the format's MIME type is VIDEO_H264.

INDEX_UNSET

public static final int INDEX_UNSET = -1

Represents an unset or unknown index or byte position.

LANGUAGE_UNDETERMINED

public static final String LANGUAGE_UNDETERMINED = "und"

Represents an undetermined language as an ISO 639-2 language code.

LENGTH_UNSET

public static final int LENGTH_UNSET = -1

Represents an unset or unknown length.

MEDIA_CODEC_PRIORITY_NON_REALTIME

@UnstableApi
public static final int MEDIA_CODEC_PRIORITY_NON_REALTIME = 1

A non-realtime (as fast as possible) codec priority.

MEDIA_CODEC_PRIORITY_REALTIME

@UnstableApi
public static final int MEDIA_CODEC_PRIORITY_REALTIME = 0

A realtime codec priority.

MICROS_PER_SECOND

@UnstableApi
public static final long MICROS_PER_SECOND = 1000000

The number of microseconds in one second.

MILLIS_PER_SECOND

@UnstableApi
public static final long MILLIS_PER_SECOND = 1000

The number of milliseconds in one second.

NANOS_PER_SECOND

@UnstableApi
public static final long NANOS_PER_SECOND = 1000000000

The number of nanoseconds in one second.

NETWORK_TYPE_2G

@UnstableApi
public static final int NETWORK_TYPE_2G = 3

Network type for a 2G cellular connection.

NETWORK_TYPE_3G

@UnstableApi
public static final int NETWORK_TYPE_3G = 4

Network type for a 3G cellular connection.

NETWORK_TYPE_4G

@UnstableApi
public static final int NETWORK_TYPE_4G = 5

Network type for a 4G cellular connection.

NETWORK_TYPE_5G_NSA

@UnstableApi
public static final int NETWORK_TYPE_5G_NSA = 10

Network type for a 5G non-stand-alone (NSA) cellular connection.

NETWORK_TYPE_5G_SA

@UnstableApi
public static final int NETWORK_TYPE_5G_SA = 9

Network type for a 5G stand-alone (SA) cellular connection.

NETWORK_TYPE_CELLULAR_UNKNOWN

@UnstableApi
public static final int NETWORK_TYPE_CELLULAR_UNKNOWN = 6

Network type for cellular connections which cannot be mapped to one of NETWORK_TYPE_2G, NETWORK_TYPE_3G, or NETWORK_TYPE_4G.

NETWORK_TYPE_ETHERNET

@UnstableApi
public static final int NETWORK_TYPE_ETHERNET = 7

Network type for an Ethernet connection.

NETWORK_TYPE_OFFLINE

@UnstableApi
public static final int NETWORK_TYPE_OFFLINE = 1

No network connection.

NETWORK_TYPE_OTHER

@UnstableApi
public static final int NETWORK_TYPE_OTHER = 8

Network type for other connections which are not Wifi or cellular (e.g. VPN, Bluetooth).

NETWORK_TYPE_UNKNOWN

@UnstableApi
public static final int NETWORK_TYPE_UNKNOWN = 0

Unknown network type.

NETWORK_TYPE_WIFI

@UnstableApi
public static final int NETWORK_TYPE_WIFI = 2

Network type for a Wifi connection.

PERCENTAGE_UNSET

@UnstableApi
public static final int PERCENTAGE_UNSET = -1

Represents an unset or unknown percentage.

PLAYREADY_UUID

public static final UUID PLAYREADY_UUID

UUID for the PlayReady DRM scheme.

PlayReady is supported on all AndroidTV devices. Note that most other Android devices do not provide PlayReady support.

POSITION_UNSET

@UnstableApi
public static final int POSITION_UNSET = -1

PRIORITY_DOWNLOAD

@UnstableApi
public static final int PRIORITY_DOWNLOAD = -4000

Priority for media downloading unrelated to active playback.

PRIORITY_MAX

@UnstableApi
public static final int PRIORITY_MAX = 0

The maximum supported Priority.

PRIORITY_PLAYBACK

@UnstableApi
public static final int PRIORITY_PLAYBACK = -1000

Priority for active media playback.

PRIORITY_PLAYBACK_PRELOAD

@UnstableApi
public static final int PRIORITY_PLAYBACK_PRELOAD = -3000

Priority for preloading media playback resources before the playback becomes active.

PRIORITY_PROCESSING_BACKGROUND

@UnstableApi
public static final int PRIORITY_PROCESSING_BACKGROUND = -4000

Priority for processing media in the background (for example, when the user is not waiting for the processing to complete).

PRIORITY_PROCESSING_FOREGROUND

@UnstableApi
public static final int PRIORITY_PROCESSING_FOREGROUND = -2000

Priority for processing media in the foreground (for example, while the user is waiting for the processing to complete).

PROJECTION_CUBEMAP

@UnstableApi
public static final int PROJECTION_CUBEMAP = 2

Cube map projection.

PROJECTION_EQUIRECTANGULAR

@UnstableApi
public static final int PROJECTION_EQUIRECTANGULAR = 1

Equirectangular spherical projection.

PROJECTION_MESH

@UnstableApi
public static final int PROJECTION_MESH = 3

3-D mesh projection.

PROJECTION_RECTANGULAR

@UnstableApi
public static final int PROJECTION_RECTANGULAR = 0

Conventional rectangular projection.

RATE_UNSET

public static final float RATE_UNSET = -3.4028235E38f

Represents an unset or unknown rate.

RATE_UNSET_INT

@UnstableApi
public static final int RATE_UNSET_INT = -2147483647

Represents an unset or unknown integer rate.

RESULT_BUFFER_READ

@UnstableApi
public static final int RESULT_BUFFER_READ = -4

A return value for methods where a buffer was read.

RESULT_END_OF_INPUT

@UnstableApi
public static final int RESULT_END_OF_INPUT = -1

A return value for methods where the end of an input was encountered.

RESULT_FORMAT_READ

@UnstableApi
public static final int RESULT_FORMAT_READ = -5

A return value for methods where a format was read.

RESULT_MAX_LENGTH_EXCEEDED

@UnstableApi
public static final int RESULT_MAX_LENGTH_EXCEEDED = -2

A return value for methods where the length of parsed data exceeds the maximum length allowed.

RESULT_NOTHING_READ

@UnstableApi
public static final int RESULT_NOTHING_READ = -3

A return value for methods where nothing was read.

ROLE_FLAG_ALTERNATE

public static final int ROLE_FLAG_ALTERNATE = 2

Indicates an alternate track. For example a video track recorded from an different view point than the main track(s).

ROLE_FLAG_AUXILIARY

public static final int ROLE_FLAG_AUXILIARY = 32768

Indicates an auxiliary track. An auxiliary track provides additional information about other tracks and is generally not meant for stand-alone playback, but rather for further processing in conjunction with other tracks (for example, a track with depth information).

ROLE_FLAG_CAPTION

public static final int ROLE_FLAG_CAPTION = 64

Indicates the track contains captions. This flag may be set on video tracks to indicate the presence of burned in captions.

ROLE_FLAG_COMMENTARY

public static final int ROLE_FLAG_COMMENTARY = 8

Indicates the track contains commentary, for example from the director.

ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND

public static final int ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND = 1024

Indicates the track contains a textual description of music and sound.

ROLE_FLAG_DESCRIBES_VIDEO

public static final int ROLE_FLAG_DESCRIBES_VIDEO = 512

Indicates the track contains an audio or textual description of a video track.

ROLE_FLAG_DUB

public static final int ROLE_FLAG_DUB = 16

Indicates the track is in a different language from the original, for example dubbed audio or translated captions.

ROLE_FLAG_EASY_TO_READ

public static final int ROLE_FLAG_EASY_TO_READ = 8192

Indicates the track contains a text that has been edited for ease of reading.

ROLE_FLAG_EMERGENCY

public static final int ROLE_FLAG_EMERGENCY = 32

Indicates the track contains information about a current emergency.

ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY

public static final int ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY = 2048

Indicates the track is designed for improved intelligibility of dialogue.

ROLE_FLAG_MAIN

public static final int ROLE_FLAG_MAIN = 1

Indicates a main track.

ROLE_FLAG_SIGN

public static final int ROLE_FLAG_SIGN = 256

Indicates the track contains a visual sign-language interpretation of an audio track.

ROLE_FLAG_SUBTITLE

public static final int ROLE_FLAG_SUBTITLE = 128

Indicates the track contains subtitles. This flag may be set on video tracks to indicate the presence of burned in subtitles.

ROLE_FLAG_SUPPLEMENTARY

public static final int ROLE_FLAG_SUPPLEMENTARY = 4

Indicates a supplementary track, meaning the track has lower importance than the main track(s). For example a video track that provides a visual accompaniment to a main audio track.

ROLE_FLAG_TRANSCRIBES_DIALOG

public static final int ROLE_FLAG_TRANSCRIBES_DIALOG = 4096

Indicates the track contains a transcription of spoken dialog.

ROLE_FLAG_TRICK_PLAY

public static final int ROLE_FLAG_TRICK_PLAY = 16384

Indicates the track is intended for trick play.

SANS_SERIF_NAME

@UnstableApi
public static final String SANS_SERIF_NAME = "sans-serif"

The name of the sans-serif font family.

SELECTION_FLAG_AUTOSELECT

public static final int SELECTION_FLAG_AUTOSELECT = 4

Indicates that the player may choose to play the track in absence of an explicit user preference.

SELECTION_FLAG_DEFAULT

public static final int SELECTION_FLAG_DEFAULT = 1

Indicates that the track should be selected if user preferences do not state otherwise.

SELECTION_FLAG_FORCED

public static final int SELECTION_FLAG_FORCED = 2

Indicates that the track should be selected if its language matches the language of the selected audio track and user preferences do not state otherwise. Only applies to text tracks.

Tracks with this flag generally provide translation for elements that don't match the declared language of the selected audio track (e.g. speech in an alien language). See Netflix's summary for more info.

SELECTION_REASON_ADAPTIVE

@UnstableApi
public static final int SELECTION_REASON_ADAPTIVE = 3

A selection reason constant for an adaptive track selection.

SELECTION_REASON_CUSTOM_BASE

@UnstableApi
public static final int SELECTION_REASON_CUSTOM_BASE = 10000

Applications or extensions may define custom SELECTION_REASON_* constants greater than or equal to this value.

SELECTION_REASON_INITIAL

@UnstableApi
public static final int SELECTION_REASON_INITIAL = 1

A selection reason constant for an initial track selection.

SELECTION_REASON_MANUAL

@UnstableApi
public static final int SELECTION_REASON_MANUAL = 2

A selection reason constant for an manual (i.e. user initiated) track selection.

SELECTION_REASON_TRICK_PLAY

@UnstableApi
public static final int SELECTION_REASON_TRICK_PLAY = 4

A selection reason constant for a trick play track selection.

SELECTION_REASON_UNKNOWN

@UnstableApi
public static final int SELECTION_REASON_UNKNOWN = 0

A selection reason constant for selections whose reasons are unknown or unspecified.

SERIF_NAME

@UnstableApi
public static final String SERIF_NAME = "serif"

The name of the serif font family.

SPATIALIZATION_BEHAVIOR_AUTO

public static final int SPATIALIZATION_BEHAVIOR_AUTO = 0

See SPATIALIZATION_BEHAVIOR_AUTO.

SPATIALIZATION_BEHAVIOR_NEVER

public static final int SPATIALIZATION_BEHAVIOR_NEVER = 1

See SPATIALIZATION_BEHAVIOR_NEVER.

SSAI_SCHEME

@UnstableApi
public static final String SSAI_SCHEME = "ssai"

The URI scheme used for content with server side ad insertion.

STEREO_MODE_INTERLEAVED_LEFT_PRIMARY

@UnstableApi
public static final int STEREO_MODE_INTERLEAVED_LEFT_PRIMARY = 4

Indicates interleaved stereo layout with the left view being the primary view, used with 360/3D/VR videos.

STEREO_MODE_INTERLEAVED_RIGHT_PRIMARY

@UnstableApi
public static final int STEREO_MODE_INTERLEAVED_RIGHT_PRIMARY = 5

Indicates interleaved stereo layout with the right view being the primary view, used with 360/3D/VR videos.

STEREO_MODE_LEFT_RIGHT

@UnstableApi
public static final int STEREO_MODE_LEFT_RIGHT = 2

Indicates Left-Right stereo layout, used with 360/3D/VR videos.

STEREO_MODE_MONO

@UnstableApi
public static final int STEREO_MODE_MONO = 0

Indicates Monoscopic stereo layout, used with 360/3D/VR videos.

STEREO_MODE_STEREO_MESH

@UnstableApi
public static final int STEREO_MODE_STEREO_MESH = 3

Indicates a stereo layout where the left and right eyes have separate meshes, used with 360/3D/VR videos.

STEREO_MODE_TOP_BOTTOM

@UnstableApi
public static final int STEREO_MODE_TOP_BOTTOM = 1

Indicates Top-Bottom stereo layout, used with 360/3D/VR videos.

STREAM_TYPE_ALARM

@UnstableApi
public static final int STREAM_TYPE_ALARM = 4

See STREAM_ALARM.

STREAM_TYPE_DEFAULT

@UnstableApi
public static final int STREAM_TYPE_DEFAULT = 3

The default stream type used by audio renderers. Equal to STREAM_TYPE_MUSIC.

STREAM_TYPE_DTMF

@UnstableApi
public static final int STREAM_TYPE_DTMF = 8

See STREAM_DTMF.

STREAM_TYPE_MUSIC

@UnstableApi
public static final int STREAM_TYPE_MUSIC = 3

See STREAM_MUSIC.

STREAM_TYPE_NOTIFICATION

@UnstableApi
public static final int STREAM_TYPE_NOTIFICATION = 5

See STREAM_NOTIFICATION.

STREAM_TYPE_RING

@UnstableApi
public static final int STREAM_TYPE_RING = 2

See STREAM_RING.

STREAM_TYPE_SYSTEM

@UnstableApi
public static final int STREAM_TYPE_SYSTEM = 1

See STREAM_SYSTEM.

STREAM_TYPE_VOICE_CALL

@UnstableApi
public static final int STREAM_TYPE_VOICE_CALL = 0

See STREAM_VOICE_CALL.

TIME_END_OF_SOURCE

public static final long TIME_END_OF_SOURCE = -9223372036854775808

Special constant representing a time corresponding to the end of a source. Suitable for use in any time base.

TIME_UNSET

public static final long TIME_UNSET = -9223372036854775807

Special constant representing an unset or unknown time or duration. Suitable for use in any time base.

TRACK_TYPE_AUDIO

public static final int TRACK_TYPE_AUDIO = 1

A type constant for audio tracks.

TRACK_TYPE_CAMERA_MOTION

public static final int TRACK_TYPE_CAMERA_MOTION = 6

A type constant for camera motion tracks.

TRACK_TYPE_CUSTOM_BASE

public static final int TRACK_TYPE_CUSTOM_BASE = 10000

Applications or extensions may define custom TRACK_TYPE_* constants greater than or equal to this value.

TRACK_TYPE_DEFAULT

public static final int TRACK_TYPE_DEFAULT = 0

A type constant for tracks of some default type, where the type itself is unknown.

TRACK_TYPE_IMAGE

public static final int TRACK_TYPE_IMAGE = 4

A type constant for image tracks.

TRACK_TYPE_METADATA

public static final int TRACK_TYPE_METADATA = 5

A type constant for metadata tracks.

TRACK_TYPE_NONE

public static final int TRACK_TYPE_NONE = -2

A type constant for a fake or empty track.

TRACK_TYPE_TEXT

public static final int TRACK_TYPE_TEXT = 3

A type constant for text tracks.

TRACK_TYPE_UNKNOWN

public static final int TRACK_TYPE_UNKNOWN = -1

A type constant for tracks of unknown type.

TRACK_TYPE_VIDEO

public static final int TRACK_TYPE_VIDEO = 2

A type constant for video tracks.

TYPE_DASH

@UnstableApi
public static final int TYPE_DASH = 0

TYPE_HLS

@UnstableApi
public static final int TYPE_HLS = 2

TYPE_OTHER

@UnstableApi
public static final int TYPE_OTHER = 4

TYPE_RTSP

@UnstableApi
public static final int TYPE_RTSP = 3

TYPE_SS

@UnstableApi
public static final int TYPE_SS = 1

USAGE_ALARM

public static final int USAGE_ALARM = 4

See USAGE_ALARM.

USAGE_ASSISTANCE_ACCESSIBILITY

public static final int USAGE_ASSISTANCE_ACCESSIBILITY = 11

See USAGE_ASSISTANCE_ACCESSIBILITY.

USAGE_ASSISTANCE_NAVIGATION_GUIDANCE

public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = 12

See USAGE_ASSISTANCE_NAVIGATION_GUIDANCE.

USAGE_ASSISTANCE_SONIFICATION

public static final int USAGE_ASSISTANCE_SONIFICATION = 13

See USAGE_ASSISTANCE_SONIFICATION.

USAGE_ASSISTANT

public static final int USAGE_ASSISTANT = 16

See USAGE_ASSISTANT.

USAGE_GAME

public static final int USAGE_GAME = 14

See USAGE_GAME.

USAGE_MEDIA

public static final int USAGE_MEDIA = 1

See USAGE_MEDIA.

USAGE_NOTIFICATION

public static final int USAGE_NOTIFICATION = 5

See USAGE_NOTIFICATION.

USAGE_NOTIFICATION_COMMUNICATION_DELAYED

public static final int USAGE_NOTIFICATION_COMMUNICATION_DELAYED = 9

See USAGE_NOTIFICATION_COMMUNICATION_DELAYED.

USAGE_NOTIFICATION_COMMUNICATION_INSTANT

public static final int USAGE_NOTIFICATION_COMMUNICATION_INSTANT = 8

See USAGE_NOTIFICATION_COMMUNICATION_INSTANT.

USAGE_NOTIFICATION_COMMUNICATION_REQUEST

public static final int USAGE_NOTIFICATION_COMMUNICATION_REQUEST = 7

See USAGE_NOTIFICATION_COMMUNICATION_REQUEST.

USAGE_NOTIFICATION_EVENT

public static final int USAGE_NOTIFICATION_EVENT = 10

See USAGE_NOTIFICATION_EVENT.

USAGE_NOTIFICATION_RINGTONE

public static final int USAGE_NOTIFICATION_RINGTONE = 6

See USAGE_NOTIFICATION_RINGTONE.

USAGE_UNKNOWN

public static final int USAGE_UNKNOWN = 0

See USAGE_UNKNOWN.

USAGE_VOICE_COMMUNICATION

public static final int USAGE_VOICE_COMMUNICATION = 2

See USAGE_VOICE_COMMUNICATION.

USAGE_VOICE_COMMUNICATION_SIGNALLING

public static final int USAGE_VOICE_COMMUNICATION_SIGNALLING = 3

See USAGE_VOICE_COMMUNICATION_SIGNALLING.

UUID_NIL

public static final UUID UUID_NIL

The Nil UUID as defined by RFC4122.

VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF

@UnstableApi
public static final int VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF = -2147483648

Strategy to never call setFrameRate. Use this strategy if you prefer to call setFrameRate directly from application code.

VIDEO_CHANGE_FRAME_RATE_STRATEGY_ONLY_IF_SEAMLESS

@UnstableApi
public static final int VIDEO_CHANGE_FRAME_RATE_STRATEGY_ONLY_IF_SEAMLESS = 0

Strategy to call setFrameRate with CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS when the output frame rate is known.

VIDEO_OUTPUT_MODE_NONE

@UnstableApi
public static final int VIDEO_OUTPUT_MODE_NONE = -1

Video decoder output mode is not set.

VIDEO_OUTPUT_MODE_SURFACE_YUV

@UnstableApi
public static final int VIDEO_OUTPUT_MODE_SURFACE_YUV = 1

Video decoder output mode that renders 4:2:0 YUV planes directly to a surface.

VIDEO_OUTPUT_MODE_YUV

@UnstableApi
public static final int VIDEO_OUTPUT_MODE_YUV = 0

Video decoder output mode that outputs raw 4:2:0 YUV planes.

VIDEO_SCALING_MODE_DEFAULT

@UnstableApi
public static final int VIDEO_SCALING_MODE_DEFAULT = 1

A default video scaling mode for MediaCodec-based renderers.

VIDEO_SCALING_MODE_SCALE_TO_FIT

@UnstableApi
public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT = 1

See VIDEO_SCALING_MODE_SCALE_TO_FIT.

VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING

@UnstableApi
public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = 2

See VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING.

VOLUME_FLAG_ALLOW_RINGER_MODES

public static final int VOLUME_FLAG_ALLOW_RINGER_MODES = 2

See FLAG_ALLOW_RINGER_MODES.

VOLUME_FLAG_PLAY_SOUND

public static final int VOLUME_FLAG_PLAY_SOUND = 4

See FLAG_PLAY_SOUND.

VOLUME_FLAG_REMOVE_SOUND_AND_VIBRATE

public static final int VOLUME_FLAG_REMOVE_SOUND_AND_VIBRATE = 8

See FLAG_REMOVE_SOUND_AND_VIBRATE.

VOLUME_FLAG_SHOW_UI

public static final int VOLUME_FLAG_SHOW_UI = 1

See FLAG_SHOW_UI.

VOLUME_FLAG_VIBRATE

public static final int VOLUME_FLAG_VIBRATE = 16

See FLAG_VIBRATE.

WAKE_MODE_LOCAL

public static final int WAKE_MODE_LOCAL = 1

A wake mode that will cause the player to hold a android.os.PowerManager.WakeLock during playback.

This is suitable for applications that play media with the screen off and do not load media over wifi.

WAKE_MODE_NETWORK

public static final int WAKE_MODE_NETWORK = 2

A wake mode that will cause the player to hold a android.os.PowerManager.WakeLock and a android.net.wifi.WifiManager.WifiLock during playback.

This is suitable for applications that play media with the screen off and may load media over wifi.

WAKE_MODE_NONE

public static final int WAKE_MODE_NONE = 0

A wake mode that will not cause the player to hold any locks.

This is suitable for applications that do not play media with the screen off.

WIDEVINE_UUID

public static final UUID WIDEVINE_UUID

UUID for the Widevine DRM scheme.

Widevine is supported on Android devices running Android 4.3 (API Level 18) and up.

Public methods

generateAudioSessionIdV21

@UnstableApi
@InlineMe(replacement = "Util.generateAudioSessionIdV21(context)", imports = [""androidx.media3.common.util.Util""])
public static int generateAudioSessionIdV21(Context context)

getErrorCodeForMediaDrmErrorCode

@UnstableApi
@InlineMe(replacement = "Util.getErrorCodeForMediaDrmErrorCode(mediaDrmErrorCode)", imports = [""androidx.media3.common.util.Util""])
@PlaybackException.ErrorCode
public static int getErrorCodeForMediaDrmErrorCode(int mediaDrmErrorCode)

getFormatSupportString

@UnstableApi
@InlineMe(replacement = "Util.getFormatSupportString(formatSupport)", imports = [""androidx.media3.common.util.Util""])
public static String getFormatSupportString(@C.FormatSupport int formatSupport)

msToUs

@UnstableApi
@InlineMe(replacement = "Util.msToUs(timeMs)", imports = [""androidx.media3.common.util.Util""])
public static long msToUs(long timeMs)

usToMs

@UnstableApi
@InlineMe(replacement = "Util.usToMs(timeUs)", imports = [""androidx.media3.common.util.Util""])
public static long usToMs(long timeUs)