Back to Exoplayer

DataSourceException (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/DataSourceException.html

latest8.9 KB
Original Source

Package com.google.android.exoplayer2.upstream

Class DataSourceException

  • java.lang.Object

  • All Implemented Interfaces:SerializableDirect Known Subclasses:AssetDataSource.AssetDataSourceException, ContentDataSource.ContentDataSourceException, FileDataSource.FileDataSourceException, HttpDataSource.HttpDataSourceException, RawResourceDataSource.RawResourceDataSourceException, UdpDataSource.UdpDataSourceException


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classDataSourceExceptionextends[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

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.

Used to specify reason of a DataSource error. See Also:Serialized Form

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static int | POSITION_OUT_OF_RANGE | Deprecated. Use PlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE.

| | @com.google.android.exoplayer2.PlaybackException.ErrorCode int | reason | Deprecated.

The reason of this DataSourceException, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | DataSourceException​(@com.google.android.exoplayer2.PlaybackException.ErrorCode int reason) | Deprecated.

Constructs a DataSourceException. | | DataSourceException​(String message, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason) | Deprecated.

Constructs a DataSourceException. | | DataSourceException​(String message, Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason) | Deprecated.

Constructs a DataSourceException. | | DataSourceException​(Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason) | Deprecated.

Constructs a DataSourceException. |

Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static boolean | isCausedByPositionOutOfRange​(IOException e) | Deprecated.

Returns whether the given IOException was caused by a DataSourceException whose reason is PlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE in its cause stack. |

- 

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

- 

POSITION_OUT_OF_RANGE

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public static final int POSITION_OUT_OF_RANGE

Deprecated. Use PlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE.

Indicates that the starting position of the request was outside the bounds of the data. See Also:Constant Field Values

- 

reason

[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason

Deprecated.

The reason of this DataSourceException, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.

Constructor Detail

- 

DataSourceException

public DataSourceException​([@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)

Deprecated.

Constructs a DataSourceException. Parameters:reason - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.

- 

DataSourceException

public DataSourceException​(@Nullable[Throwable](https://developer.android.com/reference/java/lang/Throwable.html "class or interface in java.lang")cause,[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)

Deprecated.

Constructs a DataSourceException. Parameters:cause - The error cause.reason - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.

- 

DataSourceException

public DataSourceException​(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)

Deprecated.

Constructs a DataSourceException. Parameters:message - The error message.reason - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.

- 

DataSourceException

public DataSourceException​(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,
                           @Nullable[Throwable](https://developer.android.com/reference/java/lang/Throwable.html "class or interface in java.lang")cause,[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)

Deprecated.

Constructs a DataSourceException. Parameters:message - The error message.cause - The error cause.reason - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.

Method Detail

- 

isCausedByPositionOutOfRange

public static boolean isCausedByPositionOutOfRange​([IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")e)

Deprecated.

Returns whether the given IOException was caused by a DataSourceException whose reason is PlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE in its cause stack.