DefaultDataSource.Factory


class DefaultDataSource.Factory : DataSource.Factory


DataSource.Factory for DefaultDataSource instances.

Summary

Public constructors

Factory(context: Context!)

Creates an instance.

Factory(context: Context!, baseDataSourceFactory: DataSource.Factory!)

Creates an instance.

Public constructors

Factory

Factory(context: Context!)

Creates an instance.

Parameters
context: Context!

A context.

Factory

Factory(context: Context!, baseDataSourceFactory: DataSource.Factory!)

Creates an instance.

Parameters
context: Context!

A context.

baseDataSourceFactory: DataSource.Factory!

The DataSource.Factory to be used to create base DataSources for DefaultDataSource instances. The base 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 .

Public functions

createDataSource

@UnstableApi
fun createDataSource(): DefaultDataSource!

Creates a DataSource instance.

setTransferListener

@CanIgnoreReturnValue
@UnstableApi
fun setTransferListener(transferListener: TransferListener?): DefaultDataSource.Factory!

Sets the TransferListener that will be used.

The default is null.

See addTransferListener.

Parameters
transferListener: TransferListener?

The listener that will be used.

Returns
DefaultDataSource.Factory!

This factory.