ExoPlaybackException


class ExoPlaybackException : PlaybackException


Thrown when a non locally recoverable playback failure occurs.

Summary

Nested types

@UnstableApi
@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
annotation ExoPlaybackException.Type

The type of source that produced the error.

Constants

const Int

The error occurred in a remote component.

const Int

The error occurred in a Renderer.

const Int

The error occurred loading data from a MediaSource.

const Int

The error was an unexpected RuntimeException.

Public functions

java-static ExoPlaybackException!

Creates an instance of type TYPE_REMOTE.

java-static ExoPlaybackException!
@UnstableApi
createForRenderer(
    cause: Throwable!,
    rendererName: String!,
    rendererIndex: Int,
    rendererFormat: Format?,
    @C.FormatSupport rendererFormatSupport: Int,
    isRecoverable: Boolean,
    @PlaybackException.ErrorCode errorCode: Int
)

Creates an instance of type TYPE_RENDERER.

java-static ExoPlaybackException!
@UnstableApi
createForSource(cause: IOException!, errorCode: Int)

Creates an instance of type TYPE_SOURCE.

java-static ExoPlaybackException!

This function is deprecated.

Use createForUnexpected(RuntimeException, ERROR_CODE_UNSPECIFIED) instead.

java-static ExoPlaybackException!

Creates an instance of type TYPE_UNEXPECTED.

Boolean

Returns whether the error data associated to this exception equals the error data associated to other.

java-static ExoPlaybackException!

Restores a ExoPlaybackException from a Bundle.

Exception!

Retrieves the underlying error when type is TYPE_RENDERER.

IOException!

Retrieves the underlying error when type is TYPE_SOURCE.

RuntimeException!

Retrieves the underlying error when type is TYPE_UNEXPECTED.

Bundle!

Returns a representing the information stored in this exception.

Public properties

MediaSource.MediaPeriodId?

The MediaPeriodId of the media associated with this error, or null if undetermined.

Format?

If type is TYPE_RENDERER, this is the Format the renderer was using at the time of the exception, or null if the renderer wasn't using a Format.

Int

If type is TYPE_RENDERER, this is the level of FormatSupport of the renderer for rendererFormat.

Int

If type is TYPE_RENDERER, this is the index of the renderer.

String?

If type is TYPE_RENDERER, this is the name of the renderer.

Int

The Type of the playback failure.

Inherited Constants

From androidx.media3.common.PlaybackException
const Int

Player implementations that want to surface custom errors can use error codes greater than this value, so as to avoid collision with other error codes defined in this class.

const Int

Caused by an AudioTrack initialization failure.

const Int

Caused by an AudioTrack init operation failure in offload mode.

const Int

Caused by an AudioTrack write operation failure in offload mode.

const Int

Caused by an AudioTrack write operation failure.

const Int

Caused by expired authentication.

const Int

Caused by an argument that is illegal.

const Int

Caused by the loading position falling behind the sliding window of available live content.

const Int

Caused by too many concurrent streams.

const Int

Caused by a request for content that was already playing.

const Int

Caused by a decoder initialization failure.

const Int

Caused by a decoder query failure.

const Int

Caused by a failure while trying to decode media samples.

const Int

Caused by trying to decode content whose format exceeds the capabilities of the device.

const Int

Caused by trying to decode content whose format is not supported.

const Int

Caused by higher priority task reclaiming resources needed for decoding.

const Int

Caused by a disconnected component.

const Int

Caused by attempting to play incompatible DRM-protected content.

const Int

Caused by the device having revoked DRM privileges.

const Int

Caused by an operation being disallowed by a license policy.

const Int

Caused by a failure while trying to obtain a license.

const Int

Caused by an expired DRM license being loaded into an open DRM session.

const Int

Caused by a failure while provisioning the device.

const Int

Caused by a chosen DRM protection scheme not being supported by the device.

const Int

Caused by an error in the DRM system.

const Int

Caused by an unspecified error related to DRM protection.

const Int

Caused by navigation that failed because the playlist was exhausted.

const Int

Caused by a failed runtime check.

const Int

Caused by a command that cannot be completed because the current state is not valid.

const Int

Caused by an HTTP server returning an unexpected HTTP response status code.

const Int

Caused by the player trying to access cleartext HTTP traffic (meaning http:// rather than https://) when the app's Network Security Configuration does not permit it.

const Int

Caused by a non-existent file.

const Int

Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.

const Int

Caused by a network connection failure.

const Int

Caused by a network timeout, meaning the server is taking too long to fulfill a request.

const Int

Caused by lack of permission to perform an IO operation.

const Int

Caused by reading data out of the data bound.

const Int

Caused by an Input/Output error which could not be identified.

const Int

Caused by the content being blocked due to being regionally unavailable.

const Int

Caused by a command that is not supported.

const Int

Caused by the content being blocked due to parental controls.

const Int

Caused by a parsing error associated with a media container format bitstream.

const Int

Caused by attempting to extract a file with an unsupported media container format, or an unsupported media container feature.

const Int

Caused by a parsing error associated with a media manifest.

const Int

Caused by an unsupported feature in a media manifest.

const Int

Caused by a command that is not allowed.

const Int

Caused by a premium account that is required but the user is not subscribed.

const Int

Caused by an unidentified error in a remote Player, which is a Player that runs on a different host or process.

const Int

Caused by playback that needs manual user intervention.

const Int

Caused by the skip limit that is exhausted.

const Int

Caused by a generic timeout.

const Int

Caused by an error whose cause could not be identified.

const Int

Caused by a failure when processing a video frame.

const Int

Caused by a failure when initializing a VideoFrameProcessor.

const Int

Defines a minimum field ID value for subclasses to use when implementing toBundle and delegating to PlaybackException.

Inherited functions

From androidx.media3.common.PlaybackException
java-static PlaybackException!

Restores a PlaybackException from a Bundle.

String!

Equivalent to PlaybackException.getErrorCodeName(this.errorCode).

java-static String!

Returns the name of a given errorCode.

From java.lang.Throwable

Inherited properties

From androidx.media3.common.PlaybackException
Int

An error code which identifies the cause of the playback failure.

Bundle!

An extras Bundle.

Long

The value of elapsedRealtime when this exception was created.

Constants

TYPE_REMOTE

@UnstableApi
const val TYPE_REMOTE = 3: Int

The error occurred in a remote component.

Call getMessage to retrieve the message associated with the error.

TYPE_RENDERER

@UnstableApi
const val TYPE_RENDERER = 1: Int

The error occurred in a Renderer.

Call getRendererException to retrieve the underlying cause.

TYPE_SOURCE

@UnstableApi
const val TYPE_SOURCE = 0: Int

The error occurred loading data from a MediaSource.

Call getSourceException to retrieve the underlying cause.

TYPE_UNEXPECTED

@UnstableApi
const val TYPE_UNEXPECTED = 2: Int

The error was an unexpected RuntimeException.

Call getUnexpectedException to retrieve the underlying cause.

Public functions

createForRemote

@UnstableApi
java-static fun createForRemote(message: String!): ExoPlaybackException!

Creates an instance of type TYPE_REMOTE.

Parameters
message: String!

The message associated with the error.

Returns
ExoPlaybackException!

The created instance.

createForRenderer

@UnstableApi
java-static fun createForRenderer(
    cause: Throwable!,
    rendererName: String!,
    rendererIndex: Int,
    rendererFormat: Format?,
    @C.FormatSupport rendererFormatSupport: Int,
    isRecoverable: Boolean,
    @PlaybackException.ErrorCode errorCode: Int
): ExoPlaybackException!

Creates an instance of type TYPE_RENDERER.

Parameters
cause: Throwable!

The cause of the failure.

rendererName: String!

The name of the renderer in which the failure occurred.

rendererIndex: Int

The index of the renderer in which the failure occurred.

rendererFormat: Format?

The Format the renderer was using at the time of the exception, or null if the renderer wasn't using a Format.

@C.FormatSupport rendererFormatSupport: Int

The FormatSupport of the renderer for rendererFormat. Ignored if rendererFormat is null.

isRecoverable: Boolean

If the failure can be recovered by disabling and re-enabling the renderer.

@PlaybackException.ErrorCode errorCode: Int

See errorCode.

Returns
ExoPlaybackException!

The created instance.

createForSource

@UnstableApi
java-static fun createForSource(cause: IOException!, errorCode: Int): ExoPlaybackException!

Creates an instance of type TYPE_SOURCE.

Parameters
cause: IOException!

The cause of the failure.

errorCode: Int

See errorCode.

Returns
ExoPlaybackException!

The created instance.

createForUnexpected

@UnstableApi
java-static fun createForUnexpected(cause: RuntimeException!): ExoPlaybackException!

createForUnexpected

@UnstableApi
java-static fun createForUnexpected(
    cause: RuntimeException!,
    @PlaybackException.ErrorCode errorCode: Int
): ExoPlaybackException!

Creates an instance of type TYPE_UNEXPECTED.

Parameters
cause: RuntimeException!

The cause of the failure.

@PlaybackException.ErrorCode errorCode: Int

See errorCode.

Returns
ExoPlaybackException!

The created instance.

errorInfoEquals

fun errorInfoEquals(that: PlaybackException?): Boolean

Returns whether the error data associated to this exception equals the error data associated to other.

Note that this method does not compare the exceptions' stacktraces.

fromBundle

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

Restores a ExoPlaybackException from a Bundle.

getRendererException

@UnstableApi
fun getRendererException(): Exception!

Retrieves the underlying error when type is TYPE_RENDERER.

getSourceException

@UnstableApi
fun getSourceException(): IOException!

Retrieves the underlying error when type is TYPE_SOURCE.

getUnexpectedException

@UnstableApi
fun getUnexpectedException(): RuntimeException!

Retrieves the underlying error when type is TYPE_UNEXPECTED.

toBundle

@UnstableApi
fun toBundle(): Bundle!

Returns a representing the information stored in this exception.

It omits the mediaPeriodId field. The mediaPeriodId of an instance restored by fromBundle will always be null.

Public properties

mediaPeriodId

@UnstableApi
val mediaPeriodIdMediaSource.MediaPeriodId?

The MediaPeriodId of the media associated with this error, or null if undetermined.

rendererFormat

@UnstableApi
val rendererFormatFormat?

If type is TYPE_RENDERER, this is the Format the renderer was using at the time of the exception, or null if the renderer wasn't using a Format.

rendererFormatSupport

@UnstableApi
@C.FormatSupport
val rendererFormatSupportInt

If type is TYPE_RENDERER, this is the level of FormatSupport of the renderer for rendererFormat. If rendererFormat is null, this is FORMAT_HANDLED.

rendererIndex

@UnstableApi
val rendererIndexInt

If type is TYPE_RENDERER, this is the index of the renderer.

rendererName

@UnstableApi
val rendererNameString?

If type is TYPE_RENDERER, this is the name of the renderer.

type

@UnstableApi
@ExoPlaybackException.Type
val typeInt

The Type of the playback failure.