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.BaseDataSourceimplementation to keep a list ofTransferListeners.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 protectedBaseDataSource(boolean isNetwork)Deprecated.Creates base data source.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddTransferListener(TransferListener transferListener)Deprecated.Adds aTransferListenerto listen to data transfers.protected voidbytesTransferred(int bytesTransferred)Deprecated.Notifies listeners that bytes were transferred.protected voidtransferEnded()Deprecated.Notifies listeners that a transfer ended.protected voidtransferInitializing(DataSpec dataSpec)Deprecated.Notifies listeners that data transfer for the specifiedDataSpecis being initialized.protected voidtransferStarted(DataSpec dataSpec)Deprecated.Notifies listeners that data transfer for the specifiedDataSpecstarted.-
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:DataSourceAdds aTransferListenerto listen to data transfers. This method is not thread-safe.- Specified by:
addTransferListenerin interfaceDataSource- Parameters:
transferListener- ATransferListener.
-
transferInitializing
protected final void transferInitializing(DataSpec dataSpec)
Deprecated.Notifies listeners that data transfer for the specifiedDataSpecis being initialized.- Parameters:
dataSpec-DataSpecdescribing the data for initializing transfer.
-
transferStarted
protected final void transferStarted(DataSpec dataSpec)
Deprecated.Notifies listeners that data transfer for the specifiedDataSpecstarted.- Parameters:
dataSpec-DataSpecdescribing 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.
-
-