Package com.google.android.exoplayer2.upstream

## Interface HttpDataSource.Factory

- All Superinterfaces:
    `DataSource.Factory`
  All Known Implementing Classes:
    `CronetDataSource.Factory`, `CronetDataSourceFactory`, `DefaultHttpDataSource.Factory`, `DefaultHttpDataSourceFactory`, `HttpDataSource.BaseFactory`, `OkHttpDataSource.Factory`, `OkHttpDataSourceFactory`
  Enclosing interface:
    HttpDataSource

      public static interface HttpDataSource.Factory
      extends DataSource.Factory

  A factory for `HttpDataSource` instances.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `HttpDataSource` | `createDataSource()` | Creates a `DataSource` instance.
    `HttpDataSource.RequestProperties` | `getDefaultRequestProperties()` | Deprecated. Use `setDefaultRequestProperties(Map)` instead.
    `HttpDataSource.Factory` | `setDefaultRequestProperties​(Map<String,​String> defaultRequestProperties)` | Sets the default request headers for `HttpDataSource` instances created by the factory.

- - ### Method Detail

    - #### createDataSource

          HttpDataSource createDataSource()

      Description copied from interface: `DataSource.Factory`
      Creates a `DataSource` instance.
      Specified by:
        `createDataSource` in interface `DataSource.Factory`

    - #### getDefaultRequestProperties

          @Deprecated
          HttpDataSource.RequestProperties getDefaultRequestProperties()

      Deprecated.
      Use `setDefaultRequestProperties(Map)` instead.

    - #### setDefaultRequestProperties

          HttpDataSource.Factory setDefaultRequestProperties​(Map<String,​String> defaultRequestProperties)

      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.

      Parameters:
        `defaultRequestProperties` - The default request properties.
      Returns:
        This factory.