Interface TransferListener
-
- All Known Implementing Classes:
DataSourceContractTest.FakeTransferListener
,DefaultBandwidthMeter
,ExperimentalBandwidthMeter
@Deprecated public interface TransferListener
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:
- Initializing the underlying resource (e.g. opening a HTTP connection).
onTransferInitializing(DataSource, DataSpec, boolean)
is called before the initialization starts. - Starting the transfer after successfully initializing the resource.
onTransferStart(DataSource, DataSpec, boolean)
is called. Note that this only happens if the initialization was successful. - Transferring data.
onBytesTransferred(DataSource, DataSpec, boolean, int)
is called frequently during the transfer to indicate progress. - Closing the transfer and the underlying resource.
onTransferEnd(DataSource, DataSpec, boolean)
is called. Note that eachonTransferStart(DataSource, DataSpec, boolean)
will have exactly one corresponding call toonTransferEnd(DataSource, DataSpec, boolean)
.
-
-
Method Summary
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.
-
-
-
Method Detail
-
onTransferInitializing
void onTransferInitializing(DataSource source, DataSpec 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.
-
onTransferStart
void onTransferStart(DataSource source, DataSpec 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.
-
onBytesTransferred
void onBytesTransferred(DataSource source, DataSpec 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.
-
onTransferEnd
void onTransferEnd(DataSource source, DataSpec 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.
-
-