ExoPlaybackException
class ExoPlaybackException : PlaybackException
| kotlin.Any | ||||
| ↳ | kotlin.Throwable | |||
| ↳ | java.lang.Exception | |||
| ↳ | androidx.media3.common.PlaybackException | |||
| ↳ | androidx.media3.exoplayer.ExoPlaybackException |
Thrown when a non locally recoverable playback failure occurs.
Summary
Nested types |
|---|
@UnstableApiThe type of source that produced the error. |
Constants |
|
|---|---|
const Int |
The error occurred in a remote component. |
const Int |
The error occurred in a |
const Int |
The error occurred loading data from a |
const Int |
The error was an unexpected |
Public functions |
|
|---|---|
java-static ExoPlaybackException! |
@UnstableApiCreates an instance of type |
java-static ExoPlaybackException! |
@UnstableApiThis function is deprecated. Use |
java-static ExoPlaybackException! |
@UnstableApiCreates an instance of type |
java-static ExoPlaybackException! |
@UnstableApiCreates an instance of type |
java-static ExoPlaybackException! |
This function is deprecated. Use |
java-static ExoPlaybackException! |
@UnstableApiCreates an instance of type |
Boolean |
errorInfoEquals(that: PlaybackException?)Returns whether the error data associated to this exception equals the error data associated to |
Exception! |
Retrieves the underlying error when |
IOException! |
Retrieves the underlying error when |
RuntimeException! |
Retrieves the underlying error when |
Public properties |
|
|---|---|
MediaSource.MediaPeriodId? |
The |
Format? |
If |
Int |
If |
Int |
If |
String? |
If |
Int |
The |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited functions |
||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||
|
Inherited properties |
||||||
|---|---|---|---|---|---|---|
|
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 funcreateForRenderer(
cause: Throwable!,
rendererName: String!,
rendererIndex: Int,
rendererFormat: Format?,
@C.FormatSupport rendererFormatSupport: Int,
isRecoverable: Boolean,
@PlaybackException.ErrorCode errorCode: Int
): ExoPlaybackException!
createForRenderer
@UnstableApi
java-static fun createForRenderer(
cause: Throwable!,
rendererName: String!,
rendererIndex: Int,
rendererFormat: Format?,
@C.FormatSupport rendererFormatSupport: Int,
mediaPeriodId: MediaSource.MediaPeriodId?,
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 |
rendererIndex: Int |
The index of the renderer in which the failure occurred. |
rendererFormat: Format? |
The |
@C.FormatSupport rendererFormatSupport: Int |
The |
mediaPeriodId: MediaSource.MediaPeriodId? |
The |
isRecoverable: Boolean |
If the failure can be recovered by disabling and re-enabling the renderer. |
@PlaybackException.ErrorCode errorCode: Int |
See |
| 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 |
| Returns | |
|---|---|
ExoPlaybackException! |
The created instance. |
createForUnexpected
@UnstableApi
java-static funcreateForUnexpected(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 |
| 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' stack traces and extras.
getRendererException
@UnstableApi
fun getRendererException(): Exception!
Retrieves the underlying error when type is TYPE_RENDERER.
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
getSourceException
@UnstableApi
fun getSourceException(): IOException!
Retrieves the underlying error when type is TYPE_SOURCE.
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
getUnexpectedException
@UnstableApi
fun getUnexpectedException(): RuntimeException!
Retrieves the underlying error when type is TYPE_UNEXPECTED.
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
Public properties
mediaPeriodId
@UnstableApi
val mediaPeriodId: MediaSource.MediaPeriodId?
The MediaPeriodId of the media associated with this error, or null if undetermined.
rendererFormat
@UnstableApi
val rendererFormat: 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.
rendererFormatSupport
@UnstableApi
@C.FormatSupport
val rendererFormatSupport: Int
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 rendererIndex: Int
If type is TYPE_RENDERER, this is the index of the renderer.
rendererName
@UnstableApi
val rendererName: String?
If type is TYPE_RENDERER, this is the name of the renderer.