Class PlaybackException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.google.android.exoplayer2.PlaybackException
-
- All Implemented Interfaces:
Bundleable,Serializable
- Direct Known Subclasses:
ExoPlaybackException
@Deprecated public class PlaybackException extends Exception implements Bundleable
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.Thrown when a non locally recoverable playback failure occurs.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePlaybackException.ErrorCodeDeprecated.Codes that identify causes of player errors.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description static Bundleable.Creator<PlaybackException>CREATORDeprecated.Object that can create aPlaybackExceptionfrom aBundle.static intCUSTOM_ERROR_CODE_BASEDeprecated.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.static intERROR_CODE_AUDIO_TRACK_INIT_FAILEDDeprecated.Caused by an AudioTrack initialization failure.static intERROR_CODE_AUDIO_TRACK_WRITE_FAILEDDeprecated.Caused by an AudioTrack write operation failure.static intERROR_CODE_BEHIND_LIVE_WINDOWDeprecated.Caused by the loading position falling behind the sliding window of available live content.static intERROR_CODE_DECODER_INIT_FAILEDDeprecated.Caused by a decoder initialization failure.static intERROR_CODE_DECODER_QUERY_FAILEDDeprecated.Caused by a decoder query failure.static intERROR_CODE_DECODING_FAILEDDeprecated.Caused by a failure while trying to decode media samples.static intERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIESDeprecated.Caused by trying to decode content whose format exceeds the capabilities of the device.static intERROR_CODE_DECODING_FORMAT_UNSUPPORTEDDeprecated.Caused by trying to decode content whose format is not supported.static intERROR_CODE_DRM_CONTENT_ERRORDeprecated.Caused by attempting to play incompatible DRM-protected content.static intERROR_CODE_DRM_DEVICE_REVOKEDDeprecated.Caused by the device having revoked DRM privileges.static intERROR_CODE_DRM_DISALLOWED_OPERATIONDeprecated.Caused by an operation being disallowed by a license policy.static intERROR_CODE_DRM_LICENSE_ACQUISITION_FAILEDDeprecated.Caused by a failure while trying to obtain a license.static intERROR_CODE_DRM_LICENSE_EXPIREDDeprecated.Caused by an expired DRM license being loaded into an open DRM session.static intERROR_CODE_DRM_PROVISIONING_FAILEDDeprecated.Caused by a failure while provisioning the device.static intERROR_CODE_DRM_SCHEME_UNSUPPORTEDDeprecated.Caused by a chosen DRM protection scheme not being supported by the device.static intERROR_CODE_DRM_SYSTEM_ERRORDeprecated.Caused by an error in the DRM system.static intERROR_CODE_DRM_UNSPECIFIEDDeprecated.Caused by an unspecified error related to DRM protection.static intERROR_CODE_FAILED_RUNTIME_CHECKDeprecated.Caused by a failed runtime check.static intERROR_CODE_IO_BAD_HTTP_STATUSDeprecated.Caused by an HTTP server returning an unexpected HTTP response status code.static intERROR_CODE_IO_CLEARTEXT_NOT_PERMITTEDDeprecated.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.static intERROR_CODE_IO_FILE_NOT_FOUNDDeprecated.Caused by a non-existent file.static intERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPEDeprecated.Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.static intERROR_CODE_IO_NETWORK_CONNECTION_FAILEDDeprecated.Caused by a network connection failure.static intERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUTDeprecated.Caused by a network timeout, meaning the server is taking too long to fulfill a request.static intERROR_CODE_IO_NO_PERMISSIONDeprecated.Caused by lack of permission to perform an IO operation.static intERROR_CODE_IO_READ_POSITION_OUT_OF_RANGEDeprecated.Caused by reading data out of the data bound.static intERROR_CODE_IO_UNSPECIFIEDDeprecated.Caused by an Input/Output error which could not be identified.static intERROR_CODE_PARSING_CONTAINER_MALFORMEDDeprecated.Caused by a parsing error associated with a media container format bitstream.static intERROR_CODE_PARSING_CONTAINER_UNSUPPORTEDDeprecated.Caused by attempting to extract a file with an unsupported media container format, or an unsupported media container feature.static intERROR_CODE_PARSING_MANIFEST_MALFORMEDDeprecated.Caused by a parsing error associated with a media manifest.static intERROR_CODE_PARSING_MANIFEST_UNSUPPORTEDDeprecated.Caused by an unsupported feature in a media manifest.static intERROR_CODE_REMOTE_ERRORDeprecated.Caused by an unidentified error in a remote Player, which is a Player that runs on a different host or process.static intERROR_CODE_TIMEOUTDeprecated.Caused by a generic timeout.static intERROR_CODE_UNSPECIFIEDDeprecated.Caused by an error whose cause could not be identified.static intERROR_CODE_VIDEO_FRAME_PROCESSING_FAILEDDeprecated.Caused by a failure when processing a video frame.static intERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILEDDeprecated.Caused by a failure when initializing aVideoFrameProcessor.@com.google.android.exoplayer2.PlaybackException.ErrorCode interrorCodeDeprecated.An error code which identifies the cause of the playback failure.protected static intFIELD_CUSTOM_ID_BASEDeprecated.Defines a minimum field ID value for subclasses to use when implementingtoBundle()andBundleable.Creator.longtimestampMsDeprecated.The value ofSystemClock.elapsedRealtime()when this exception was created.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlaybackException(Bundle bundle)Deprecated.Creates a new instance using the fields obtained from the givenBundle.PlaybackException(String message, Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode)Deprecated.Creates an instance.protectedPlaybackException(String message, Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode, long timestampMs)Deprecated.Creates a new instance using the given values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanerrorInfoEquals(PlaybackException other)Deprecated.Returns whether the error data associated to this exception equals the error data associated toother.StringgetErrorCodeName()Deprecated.Equivalent toPlaybackException.getErrorCodeName(this.errorCode).static StringgetErrorCodeName(@com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode)Deprecated.Returns the name of a givenerrorCode.BundletoBundle()Deprecated.Returns aBundlerepresenting the information stored in this object.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
ERROR_CODE_UNSPECIFIED
public static final int ERROR_CODE_UNSPECIFIED
Deprecated.Caused by an error whose cause could not be identified.- See Also:
- Constant Field Values
-
ERROR_CODE_REMOTE_ERROR
public static final int ERROR_CODE_REMOTE_ERROR
Deprecated.Caused by an unidentified error in a remote Player, which is a Player that runs on a different host or process.- See Also:
- Constant Field Values
-
ERROR_CODE_BEHIND_LIVE_WINDOW
public static final int ERROR_CODE_BEHIND_LIVE_WINDOW
Deprecated.Caused by the loading position falling behind the sliding window of available live content.- See Also:
- Constant Field Values
-
ERROR_CODE_TIMEOUT
public static final int ERROR_CODE_TIMEOUT
Deprecated.Caused by a generic timeout.- See Also:
- Constant Field Values
-
ERROR_CODE_FAILED_RUNTIME_CHECK
public static final int ERROR_CODE_FAILED_RUNTIME_CHECK
Deprecated.Caused by a failed runtime check.This can happen when the application fails to comply with the player's API requirements (for example, by passing invalid arguments), or when the player reaches an invalid state.
- See Also:
- Constant Field Values
-
ERROR_CODE_IO_UNSPECIFIED
public static final int ERROR_CODE_IO_UNSPECIFIED
Deprecated.Caused by an Input/Output error which could not be identified.- See Also:
- Constant Field Values
-
ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
Deprecated.Caused by a network connection failure.The following is a non-exhaustive list of possible reasons:
- There is no network connectivity (you can check this by querying
ConnectivityManager.getActiveNetwork()). - The URL's domain is misspelled or does not exist.
- The target host is unreachable.
- The server unexpectedly closes the connection.
- See Also:
- Constant Field Values
- There is no network connectivity (you can check this by querying
-
ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT
Deprecated.Caused by a network timeout, meaning the server is taking too long to fulfill a request.- See Also:
- Constant Field Values
-
ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE
public static final int ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE
Deprecated.Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.For example, this can happen when the player is expecting a piece of media, but the server returns a paywall HTML page, with content type "text/html".
- See Also:
- Constant Field Values
-
ERROR_CODE_IO_BAD_HTTP_STATUS
public static final int ERROR_CODE_IO_BAD_HTTP_STATUS
Deprecated.Caused by an HTTP server returning an unexpected HTTP response status code.- See Also:
- Constant Field Values
-
ERROR_CODE_IO_FILE_NOT_FOUND
public static final int ERROR_CODE_IO_FILE_NOT_FOUND
Deprecated.Caused by a non-existent file.- See Also:
- Constant Field Values
-
ERROR_CODE_IO_NO_PERMISSION
public static final int ERROR_CODE_IO_NO_PERMISSION
Deprecated.Caused by lack of permission to perform an IO operation. For example, lack of permission to access internet or external storage.- See Also:
- Constant Field Values
-
ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED
public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED
Deprecated.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.- See Also:
- Constant Field Values
-
ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE
public static final int ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE
Deprecated.Caused by reading data out of the data bound.- See Also:
- Constant Field Values
-
ERROR_CODE_PARSING_CONTAINER_MALFORMED
public static final int ERROR_CODE_PARSING_CONTAINER_MALFORMED
Deprecated.Caused by a parsing error associated with a media container format bitstream.- See Also:
- Constant Field Values
-
ERROR_CODE_PARSING_MANIFEST_MALFORMED
public static final int ERROR_CODE_PARSING_MANIFEST_MALFORMED
Deprecated.Caused by a parsing error associated with a media manifest. Examples of a media manifest are a DASH or a SmoothStreaming manifest, or an HLS playlist.- See Also:
- Constant Field Values
-
ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED
public static final int ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED
Deprecated.Caused by attempting to extract a file with an unsupported media container format, or an unsupported media container feature.- See Also:
- Constant Field Values
-
ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED
public static final int ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED
Deprecated.Caused by an unsupported feature in a media manifest. Examples of a media manifest are a DASH or a SmoothStreaming manifest, or an HLS playlist.- See Also:
- Constant Field Values
-
ERROR_CODE_DECODER_INIT_FAILED
public static final int ERROR_CODE_DECODER_INIT_FAILED
Deprecated.Caused by a decoder initialization failure.- See Also:
- Constant Field Values
-
ERROR_CODE_DECODER_QUERY_FAILED
public static final int ERROR_CODE_DECODER_QUERY_FAILED
Deprecated.Caused by a decoder query failure.- See Also:
- Constant Field Values
-
ERROR_CODE_DECODING_FAILED
public static final int ERROR_CODE_DECODING_FAILED
Deprecated.Caused by a failure while trying to decode media samples.- See Also:
- Constant Field Values
-
ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES
public static final int ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES
Deprecated.Caused by trying to decode content whose format exceeds the capabilities of the device.- See Also:
- Constant Field Values
-
ERROR_CODE_DECODING_FORMAT_UNSUPPORTED
public static final int ERROR_CODE_DECODING_FORMAT_UNSUPPORTED
Deprecated.Caused by trying to decode content whose format is not supported.- See Also:
- Constant Field Values
-
ERROR_CODE_AUDIO_TRACK_INIT_FAILED
public static final int ERROR_CODE_AUDIO_TRACK_INIT_FAILED
Deprecated.Caused by an AudioTrack initialization failure.- See Also:
- Constant Field Values
-
ERROR_CODE_AUDIO_TRACK_WRITE_FAILED
public static final int ERROR_CODE_AUDIO_TRACK_WRITE_FAILED
Deprecated.Caused by an AudioTrack write operation failure.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_UNSPECIFIED
public static final int ERROR_CODE_DRM_UNSPECIFIED
Deprecated.Caused by an unspecified error related to DRM protection.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_SCHEME_UNSUPPORTED
public static final int ERROR_CODE_DRM_SCHEME_UNSUPPORTED
Deprecated.Caused by a chosen DRM protection scheme not being supported by the device. Examples of DRM protection schemes are ClearKey and Widevine.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_PROVISIONING_FAILED
public static final int ERROR_CODE_DRM_PROVISIONING_FAILED
Deprecated.Caused by a failure while provisioning the device.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_CONTENT_ERROR
public static final int ERROR_CODE_DRM_CONTENT_ERROR
Deprecated.Caused by attempting to play incompatible DRM-protected content.For example, this can happen when attempting to play a DRM protected stream using a scheme (like Widevine) for which there is no corresponding license acquisition data (like a pssh box).
- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED
public static final int ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED
Deprecated.Caused by a failure while trying to obtain a license.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_DISALLOWED_OPERATION
public static final int ERROR_CODE_DRM_DISALLOWED_OPERATION
Deprecated.Caused by an operation being disallowed by a license policy.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_SYSTEM_ERROR
public static final int ERROR_CODE_DRM_SYSTEM_ERROR
Deprecated.Caused by an error in the DRM system.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_DEVICE_REVOKED
public static final int ERROR_CODE_DRM_DEVICE_REVOKED
Deprecated.Caused by the device having revoked DRM privileges.- See Also:
- Constant Field Values
-
ERROR_CODE_DRM_LICENSE_EXPIRED
public static final int ERROR_CODE_DRM_LICENSE_EXPIRED
Deprecated.Caused by an expired DRM license being loaded into an open DRM session.- See Also:
- Constant Field Values
-
ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED
public static final int ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED
Deprecated.Caused by a failure when initializing aVideoFrameProcessor.- See Also:
- Constant Field Values
-
ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED
public static final int ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED
Deprecated.Caused by a failure when processing a video frame.- See Also:
- Constant Field Values
-
CUSTOM_ERROR_CODE_BASE
public static final int CUSTOM_ERROR_CODE_BASE
Deprecated.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.- See Also:
- Constant Field Values
-
errorCode
@ErrorCode public final @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode
Deprecated.An error code which identifies the cause of the playback failure.
-
timestampMs
public final long timestampMs
Deprecated.The value ofSystemClock.elapsedRealtime()when this exception was created.
-
FIELD_CUSTOM_ID_BASE
protected static final int FIELD_CUSTOM_ID_BASE
Deprecated.Defines a minimum field ID value for subclasses to use when implementingtoBundle()andBundleable.Creator.Subclasses should obtain their
Bundle'sfield keys by applying a non-negative offset on this constant and passing the result toUtil.intToStringMaxRadix(int).- See Also:
- Constant Field Values
-
CREATOR
public static final Bundleable.Creator<PlaybackException> CREATOR
Deprecated.Object that can create aPlaybackExceptionfrom aBundle.
-
-
Constructor Detail
-
PlaybackException
public PlaybackException(@Nullable String message, @Nullable Throwable cause, @ErrorCode @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode)Deprecated.Creates an instance.- Parameters:
errorCode- A number which identifies the cause of the error. May be one of theErrorCodes.cause- SeeThrowable.getCause().message- SeeThrowable.getMessage().
-
PlaybackException
protected PlaybackException(Bundle bundle)
Deprecated.Creates a new instance using the fields obtained from the givenBundle.
-
PlaybackException
protected PlaybackException(@Nullable String message, @Nullable Throwable cause, @ErrorCode @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode, long timestampMs)Deprecated.Creates a new instance using the given values.
-
-
Method Detail
-
getErrorCodeName
public static String getErrorCodeName(@ErrorCode @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode)
Deprecated.Returns the name of a givenerrorCode.
-
getErrorCodeName
public final String getErrorCodeName()
Deprecated.Equivalent toPlaybackException.getErrorCodeName(this.errorCode).
-
errorInfoEquals
@CallSuper public boolean errorInfoEquals(@Nullable PlaybackException other)Deprecated.Returns whether the error data associated to this exception equals the error data associated toother.Note that this method does not compare the exceptions' stacktraces.
-
toBundle
@CallSuper public Bundle toBundle()
Deprecated.Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.- Specified by:
toBundlein interfaceBundleable
-
-