public final class DefaultDataSourceFactory extends Object implements DataSource.Factory
DataSource.Factory
that produces DefaultDataSource
instances that delegate to
DefaultHttpDataSource
s for non-file/asset/content URIs.Constructor and Description |
---|
DefaultDataSourceFactory(Context context,
DataSource.Factory baseDataSourceFactory) |
DefaultDataSourceFactory(Context context,
String userAgent) |
DefaultDataSourceFactory(Context context,
String userAgent,
TransferListener listener) |
DefaultDataSourceFactory(Context context,
TransferListener listener,
DataSource.Factory baseDataSourceFactory) |
Modifier and Type | Method and Description |
---|---|
DefaultDataSource |
createDataSource()
Creates a
DataSource instance. |
public DefaultDataSourceFactory(Context context, String userAgent)
context
- A context.userAgent
- The User-Agent string that should be used.public DefaultDataSourceFactory(Context context, String userAgent, @Nullable TransferListener listener)
context
- A context.userAgent
- The User-Agent string that should be used.listener
- An optional listener.public DefaultDataSourceFactory(Context context, DataSource.Factory baseDataSourceFactory)
context
- A context.baseDataSourceFactory
- A DataSource.Factory
to be used to create a base DataSource
for DefaultDataSource
.DefaultDataSource.DefaultDataSource(Context, TransferListener, DataSource)
public DefaultDataSourceFactory(Context context, @Nullable TransferListener listener, DataSource.Factory baseDataSourceFactory)
context
- A context.listener
- An optional listener.baseDataSourceFactory
- A DataSource.Factory
to be used to create a base DataSource
for DefaultDataSource
.DefaultDataSource.DefaultDataSource(Context, TransferListener, DataSource)
public DefaultDataSource createDataSource()
DataSource.Factory
DataSource
instance.createDataSource
in interface DataSource.Factory