Class PlaybackException

    • Field Detail

      • ERROR_CODE_UNSPECIFIED

        public static final int ERROR_CODE_UNSPECIFIED
        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
        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
        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
        Caused by a generic timeout.
        See Also:
        Constant Field Values
      • ERROR_CODE_FAILED_RUNTIME_CHECK

        public static final int ERROR_CODE_FAILED_RUNTIME_CHECK
        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
        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
        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
      • ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT

        public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT
        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
        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
        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
        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
        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
        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 this corresponding troubleshooting topic.

        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
        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
        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
        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
        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
        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
        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
        Caused by a decoder query failure.
        See Also:
        Constant Field Values
      • ERROR_CODE_DECODING_FAILED

        public static final int ERROR_CODE_DECODING_FAILED
        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
        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
        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
        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
        Caused by an AudioTrack write operation failure.
        See Also:
        Constant Field Values
      • ERROR_CODE_DRM_UNSPECIFIED

        public static final int ERROR_CODE_DRM_UNSPECIFIED
        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
        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
        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
        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
        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
        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
        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
        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
        Caused by an expired DRM license being loaded into an open DRM session.
        See Also:
        Constant Field Values
      • CUSTOM_ERROR_CODE_BASE

        public static final int CUSTOM_ERROR_CODE_BASE
        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
        An error code which identifies the cause of the playback failure.
    • Constructor Detail

      • PlaybackException

        public PlaybackException​(@Nullable
                                 String message,
                                 @Nullable
                                 Throwable cause,
                                 @ErrorCode
                                 @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode)
        Creates an instance.
        Parameters:
        errorCode - A number which identifies the cause of the error. May be one of the ErrorCodes.
        cause - See Throwable.getCause().
        message - See Throwable.getMessage().
      • PlaybackException

        protected PlaybackException​(Bundle bundle)
        Creates a new instance using the fields obtained from the given Bundle.
      • PlaybackException

        protected PlaybackException​(@Nullable
                                    String message,
                                    @Nullable
                                    Throwable cause,
                                    @ErrorCode
                                    @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode,
                                    long timestampMs)
        Creates a new instance using the given values.