docs/doc/reference/com/google/android/exoplayer2/upstream/TransferListener.html
Package com.google.android.exoplayer2.upstream
DataSourceContractTest.FakeTransferListener, DefaultBandwidthMeter, ExperimentalBandwidthMeter[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceTransferListener
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.
A listener of data transfer events.
A transfer usually progresses through multiple steps:
onTransferInitializing(DataSource, DataSpec, boolean) is called before the initialization starts.onTransferStart(DataSource, DataSpec, boolean) is called. Note that this only happens if the initialization was successful.onBytesTransferred(DataSource, DataSpec, boolean, int) is called frequently during the transfer to indicate progress.onTransferEnd(DataSource, DataSpec, boolean) is called. Note that each onTransferStart(DataSource, DataSpec, boolean) will have exactly one corresponding call to onTransferEnd(DataSource, DataSpec, boolean).All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | onBytesTransferred(DataSource source, DataSpec dataSpec, boolean isNetwork, int bytesTransferred) |
Deprecated.
Called incrementally during a transfer.
|
| void | onTransferEnd(DataSource source, DataSpec dataSpec, boolean isNetwork) |
Deprecated.
Called when a transfer ends.
|
| void | onTransferInitializing(DataSource source, DataSpec dataSpec, boolean isNetwork) |
Deprecated.
Called when a transfer is being initialized.
|
| void | onTransferStart(DataSource source, DataSpec dataSpec, boolean isNetwork) |
Deprecated.
Called when a transfer starts. |
-
void onTransferInitializing([DataSource](DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
boolean isNetwork)
Deprecated.
Called when a transfer is being initialized.
Parameters:source - The source performing the transfer.dataSpec - Describes the data for which the transfer is initialized.isNetwork - Whether the data is transferred through a network.
-
void onTransferStart([DataSource](DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
boolean isNetwork)
Deprecated.
Called when a transfer starts.
Parameters:source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.
-
void onBytesTransferred([DataSource](DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
boolean isNetwork,
int bytesTransferred)
Deprecated.
Called incrementally during a transfer.
Parameters:source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.bytesTransferred - The number of bytes transferred since the previous call to this method.
-
void onTransferEnd([DataSource](DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
boolean isNetwork)
Deprecated.
Called when a transfer ends.
Parameters:source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.