DefaultDataSource.Factory


public final class DefaultDataSource.Factory implements DataSource.Factory


DataSource.Factory for DefaultDataSource instances.

Summary

Public constructors

Factory(Context context)

Creates an instance.

Factory(Context context, DataSource.Factory baseDataSourceFactory)

Creates an instance.

Public constructors

Factory

public Factory(Context context)

Creates an instance.

Parameters
Context context

A context.

Factory

public Factory(Context context, DataSource.Factory baseDataSourceFactory)

Creates an instance.

Parameters
Context context

A context.

DataSource.Factory baseDataSourceFactory

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 methods

createDataSource

@UnstableApi
public DefaultDataSource createDataSource()

Creates a DataSource instance.

setTransferListener

@CanIgnoreReturnValue
@UnstableApi
public DefaultDataSource.Factory setTransferListener(@Nullable TransferListener transferListener)

Sets the TransferListener that will be used.

The default is null.

See addTransferListener.

Parameters
@Nullable TransferListener transferListener

The listener that will be used.

Returns
DefaultDataSource.Factory

This factory.