Back to Exoplayer

DefaultDataSource.Factory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/DefaultDataSource.Factory.html

latest4.4 KB
Original Source

Package com.google.android.exoplayer2.upstream

Class DefaultDataSource.Factory


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.

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 a DataSource instance. | | DefaultDataSource.Factory | setTransferListener​(TransferListener transferListener) | Sets the TransferListener that will be used. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

Factory

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.

- 

Factory

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.

Method Detail

- 

setTransferListener

@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.

- 

createDataSource

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