Package com.google.android.exoplayer2.ext.okhttp

## Class OkHttpDataSourceFactory

- java.lang.Object
- - com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory
  - - com.google.android.exoplayer2.ext.okhttp.OkHttpDataSourceFactory

- All Implemented Interfaces:
    `DataSource.Factory`, `HttpDataSource.Factory`

      @Deprecated
      public final class OkHttpDataSourceFactory
      extends HttpDataSource.BaseFactory

  Deprecated.
  Use `OkHttpDataSource.Factory` instead.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory)` | Deprecated. Creates an instance.
    `OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory, String userAgent)` | Deprecated. Creates an instance.
    `OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory, String userAgent, TransferListener listener)` | Deprecated. Creates an instance.
    `OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory, String userAgent, TransferListener listener, okhttp3.CacheControl cacheControl)` | Deprecated. Creates an instance.
    `OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory, String userAgent, okhttp3.CacheControl cacheControl)` | Deprecated. Creates an instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected OkHttpDataSource` | `createDataSourceInternal​(HttpDataSource.RequestProperties defaultRequestProperties)` | Deprecated. Called by `HttpDataSource.BaseFactory.createDataSource()` to create a `HttpDataSource` instance.

    - ### Methods inherited from class com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory

      `createDataSource, getDefaultRequestProperties, setDefaultRequestProperties`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### OkHttpDataSourceFactory

          public OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory)

      Deprecated.
      Creates an instance.
      Parameters:
        `callFactory` - A `Call.Factory` (typically an `OkHttpClient`) for use by the sources created by the factory.

    - #### OkHttpDataSourceFactory

          public OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory,
                                         @Nullable
                                         String userAgent)

      Deprecated.
      Creates an instance.
      Parameters:
        `callFactory` - A `Call.Factory` (typically an `OkHttpClient`) for use by the sources created by the factory.
        `userAgent` - An optional User-Agent string.

    - #### OkHttpDataSourceFactory

          public OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory,
                                         @Nullable
                                         String userAgent,
                                         @Nullable
                                         okhttp3.CacheControl cacheControl)

      Deprecated.
      Creates an instance.
      Parameters:
        `callFactory` - A `Call.Factory` (typically an `OkHttpClient`) for use by the sources created by the factory.
        `userAgent` - An optional User-Agent string.
        `cacheControl` - An optional `CacheControl` for setting the Cache-Control header.

    - #### OkHttpDataSourceFactory

          public OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory,
                                         @Nullable
                                         String userAgent,
                                         @Nullable
                                         TransferListener listener)

      Deprecated.
      Creates an instance.
      Parameters:
        `callFactory` - A `Call.Factory` (typically an `OkHttpClient`) for use by the sources created by the factory.
        `userAgent` - An optional User-Agent string.
        `listener` - An optional listener.

    - #### OkHttpDataSourceFactory

          public OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory,
                                         @Nullable
                                         String userAgent,
                                         @Nullable
                                         TransferListener listener,
                                         @Nullable
                                         okhttp3.CacheControl cacheControl)

      Deprecated.
      Creates an instance.
      Parameters:
        `callFactory` - A `Call.Factory` (typically an `OkHttpClient`) for use by the sources created by the factory.
        `userAgent` - An optional User-Agent string.
        `listener` - An optional listener.
        `cacheControl` - An optional `CacheControl` for setting the Cache-Control header.

  - ### Method Detail

    - #### createDataSourceInternal

          protected OkHttpDataSource createDataSourceInternal​(HttpDataSource.RequestProperties defaultRequestProperties)

      Deprecated.
      Description copied from class: `HttpDataSource.BaseFactory`
      Called by `HttpDataSource.BaseFactory.createDataSource()` to create a `HttpDataSource` instance.
      Specified by:
        `createDataSourceInternal` in class `HttpDataSource.BaseFactory`
      Parameters:
        `defaultRequestProperties` - The default `RequestProperties` to be used by the `HttpDataSource` instance.
      Returns:
        A `HttpDataSource` instance.