docs/doc/reference/com/google/android/exoplayer2/upstream/HttpDataSource.BaseFactory.html
Package com.google.android.exoplayer2.upstream
All Implemented Interfaces:DataSource.Factory, HttpDataSource.FactoryDirect Known Subclasses:CronetDataSourceFactory, OkHttpDataSourceFactoryEnclosing interface:HttpDataSource
public abstract static classHttpDataSource.BaseFactoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[HttpDataSource.Factory](HttpDataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")
Base implementation of HttpDataSource.Factory that sets default request properties.
Constructors | Constructor | Description |
| --- | --- |
| BaseFactory() | |
All Methods Instance Methods Abstract Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| HttpDataSource | createDataSource() |
Creates a DataSource instance.
|
| protected abstract HttpDataSource | createDataSourceInternal(HttpDataSource.RequestProperties defaultRequestProperties) |
Called by createDataSource() to create a HttpDataSource instance.
|
| HttpDataSource.Factory | setDefaultRequestProperties(Map<String,String> defaultRequestProperties) |
Sets the default request headers for HttpDataSource instances created by the factory.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public BaseFactory()
-
public final[HttpDataSource](HttpDataSource.html "interface in com.google.android.exoplayer2.upstream")createDataSource()
Description copied from interface: DataSource.Factory
Creates a DataSource instance.
Specified by:createDataSource in interface DataSource.FactorySpecified by:createDataSource in interface HttpDataSource.Factory
-
@CanIgnoreReturnValue
public final[HttpDataSource.Factory](HttpDataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")setDefaultRequestProperties([Map](https://developer.android.com/reference/java/util/Map.html "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang"),[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")> defaultRequestProperties)
Description copied from interface: HttpDataSource.Factory
Sets the default request headers for HttpDataSource instances created by the factory.
The new request properties will be used for future requests made by HttpDataSources created by the factory, including instances that have already been created. Modifying the defaultRequestProperties map after a call to this method will have no effect, and so it's necessary to call this method again each time the request properties need to be updated.
Specified by:setDefaultRequestProperties in interface HttpDataSource.FactoryParameters:defaultRequestProperties - The default request properties.Returns:This factory.
-
protected abstract[HttpDataSource](HttpDataSource.html "interface in com.google.android.exoplayer2.upstream")createDataSourceInternal([HttpDataSource.RequestProperties](HttpDataSource.RequestProperties.html "class in com.google.android.exoplayer2.upstream")defaultRequestProperties)
Called by createDataSource() to create a HttpDataSource instance.
Parameters:defaultRequestProperties - The default RequestProperties to be used by the HttpDataSource instance.Returns:A HttpDataSource instance.