Class DefaultDataSource.Factory
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.DefaultDataSource.Factory
-
- All Implemented Interfaces:
DataSource.Factory
- Enclosing class:
- DefaultDataSource
public static final class DefaultDataSource.Factory extends Object implements DataSource.Factory
DataSource.Factory
forDefaultDataSource
instances.
-
-
Constructor Summary
Constructors Constructor Description Factory(Context context)
Creates an instance.Factory(Context context, DataSource.Factory baseDataSourceFactory)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultDataSource
createDataSource()
Creates aDataSource
instance.DefaultDataSource.Factory
setTransferListener(TransferListener transferListener)
Sets theTransferListener
that will be used.
-
-
-
Constructor Detail
-
Factory
public Factory(Context context)
Creates an instance.- Parameters:
context
- A context.
-
Factory
public Factory(Context context, DataSource.Factory baseDataSourceFactory)
Creates an instance.- Parameters:
context
- A context.baseDataSourceFactory
- TheDataSource.Factory
to be used to create baseDataSources
forDefaultDataSource
instances. The baseDataSource
is normally anHttpDataSource
, and is responsible for fetching data over HTTP and HTTPS, as well as any other URI schemes not otherwise supported byDefaultDataSource
.
-
-
Method Detail
-
setTransferListener
@CanIgnoreReturnValue public DefaultDataSource.Factory setTransferListener(@Nullable TransferListener transferListener)
Sets theTransferListener
that will be used.The default is
null
.- Parameters:
transferListener
- The listener that will be used.- Returns:
- This factory.
-
createDataSource
public DefaultDataSource createDataSource()
Description copied from interface:DataSource.Factory
Creates aDataSource
instance.- Specified by:
createDataSource
in interfaceDataSource.Factory
-
-