Class BaseDataSource
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.BaseDataSource
-
- All Implemented Interfaces:
DataReader
,DataSource
- Direct Known Subclasses:
AssetDataSource
,ByteArrayDataSource
,ContentDataSource
,CronetDataSource
,DataSchemeDataSource
,DefaultHttpDataSource
,FakeDataSource
,FileDataSource
,OkHttpDataSource
,RawResourceDataSource
,RtmpDataSource
,UdpDataSource
@Deprecated public abstract class BaseDataSource extends Object implements DataSource
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.BaseDataSource
implementation to keep a list ofTransferListener
s.Subclasses must call
transferInitializing(DataSpec)
,transferStarted(DataSpec)
,bytesTransferred(int)
, andtransferEnded()
to inform listeners of data transfers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.upstream.DataSource
DataSource.Factory
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseDataSource(boolean isNetwork)
Deprecated.Creates base data source.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addTransferListener(TransferListener transferListener)
Deprecated.Adds aTransferListener
to listen to data transfers.protected void
bytesTransferred(int bytesTransferred)
Deprecated.Notifies listeners that bytes were transferred.protected void
transferEnded()
Deprecated.Notifies listeners that a transfer ended.protected void
transferInitializing(DataSpec dataSpec)
Deprecated.Notifies listeners that data transfer for the specifiedDataSpec
is being initialized.protected void
transferStarted(DataSpec dataSpec)
Deprecated.Notifies listeners that data transfer for the specifiedDataSpec
started.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.upstream.DataReader
read
-
Methods inherited from interface com.google.android.exoplayer2.upstream.DataSource
close, getResponseHeaders, getUri, open
-
-
-
-
Method Detail
-
addTransferListener
public final void addTransferListener(TransferListener transferListener)
Deprecated.Description copied from interface:DataSource
Adds aTransferListener
to listen to data transfers. This method is not thread-safe.- Specified by:
addTransferListener
in interfaceDataSource
- Parameters:
transferListener
- ATransferListener
.
-
transferInitializing
protected final void transferInitializing(DataSpec dataSpec)
Deprecated.Notifies listeners that data transfer for the specifiedDataSpec
is being initialized.- Parameters:
dataSpec
-DataSpec
describing the data for initializing transfer.
-
transferStarted
protected final void transferStarted(DataSpec dataSpec)
Deprecated.Notifies listeners that data transfer for the specifiedDataSpec
started.- Parameters:
dataSpec
-DataSpec
describing the data being transferred.
-
bytesTransferred
protected final void bytesTransferred(int bytesTransferred)
Deprecated.Notifies listeners that bytes were transferred.- Parameters:
bytesTransferred
- The number of bytes transferred since the previous call to this method (or if the first call, since the transfer was started).
-
transferEnded
protected final void transferEnded()
Deprecated.Notifies listeners that a transfer ended.
-
-