docs/doc/reference/com/google/android/exoplayer2/upstream/DefaultDataSource.Factory.html
Package com.google.android.exoplayer2.upstream
All Implemented Interfaces:DataSource.FactoryEnclosing class:DefaultDataSource
public static final classDefaultDataSource.Factoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[DataSource.Factory](DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")
DataSource.Factory for DefaultDataSource instances.
Constructors | Constructor | Description |
| --- | --- |
| Factory(Context context) |
Creates an instance.
|
| Factory(Context context, DataSource.Factory baseDataSourceFactory) |
Creates an instance.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| DefaultDataSource | createDataSource() |
Creates a DataSource instance.
|
| DefaultDataSource.Factory | setTransferListener(TransferListener transferListener) |
Sets the TransferListener that will be used.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public Factory([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)
Creates an instance.
Parameters:context - A context.
-
public Factory([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[DataSource.Factory](DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")baseDataSourceFactory)
Creates an instance.
Parameters:context - A context.baseDataSourceFactory - The DataSource.Factory to be used to create base DataSources for DefaultDataSource instances. The base DataSource is normally an HttpDataSource, and is responsible for fetching data over HTTP and HTTPS, as well as any other URI schemes not otherwise supported by DefaultDataSource.
-
@CanIgnoreReturnValue
public[DefaultDataSource.Factory](DefaultDataSource.Factory.html "class in com.google.android.exoplayer2.upstream")setTransferListener(@Nullable[TransferListener](TransferListener.html "interface in com.google.android.exoplayer2.upstream")transferListener)
Sets the TransferListener that will be used.
The default is null.
See DataSource.addTransferListener(TransferListener).
Parameters:transferListener - The listener that will be used.Returns:This factory.
-
public[DefaultDataSource](DefaultDataSource.html "class in com.google.android.exoplayer2.upstream")createDataSource()
Description copied from interface: DataSource.Factory
Creates a DataSource instance.
Specified by:createDataSource in interface DataSource.Factory