Package com.google.android.exoplayer2.ext.cronet

## Class CronetDataSourceFactory

- java.lang.Object
- - com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory
  - - com.google.android.exoplayer2.ext.cronet.CronetDataSourceFactory

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

      @Deprecated
      public final class CronetDataSourceFactory
      extends HttpDataSource.BaseFactory

  Deprecated.
  Use `CronetDataSource.Factory` instead.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `DEFAULT_CONNECT_TIMEOUT_MILLIS` | Deprecated. The default connection timeout, in milliseconds.
    `static int` | `DEFAULT_READ_TIMEOUT_MILLIS` | Deprecated. The default read timeout, in milliseconds.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, int connectTimeoutMs, int readTimeoutMs, boolean resetTimeoutOnRedirects, HttpDataSource.Factory fallbackFactory)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, int connectTimeoutMs, int readTimeoutMs, boolean resetTimeoutOnRedirects, String userAgent)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, HttpDataSource.Factory fallbackFactory)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, TransferListener transferListener)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, TransferListener transferListener, int connectTimeoutMs, int readTimeoutMs, boolean resetTimeoutOnRedirects, HttpDataSource.Factory fallbackFactory)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, TransferListener transferListener, int connectTimeoutMs, int readTimeoutMs, boolean resetTimeoutOnRedirects, String userAgent)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, TransferListener transferListener, HttpDataSource.Factory fallbackFactory)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, TransferListener transferListener, String userAgent)` | Deprecated. Creates an instance.
    `CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper, Executor executor, String userAgent)` | Deprecated. Creates an instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected HttpDataSource` | `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`

- - ### Field Detail

    - #### DEFAULT_CONNECT_TIMEOUT_MILLIS

          public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS

      Deprecated.
      The default connection timeout, in milliseconds.
      See Also:
        Constant Field Values

    - #### DEFAULT_READ_TIMEOUT_MILLIS

          public static final int DEFAULT_READ_TIMEOUT_MILLIS

      Deprecated.
      The default read timeout, in milliseconds.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         HttpDataSource.Factory fallbackFactory)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, the provided fallback `HttpDataSource.Factory` will be used instead.

      Sets `CronetDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS` as the connection timeout, `CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS` as the read timeout.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `fallbackFactory` - A `HttpDataSource.Factory` which is used as a fallback in case no suitable CronetEngine can be build.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, a `DefaultHttpDataSource.Factory` will be used instead.

      Sets `CronetDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS` as the connection timeout, `CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS` as the read timeout.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         @Nullable
                                         String userAgent)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, a `DefaultHttpDataSource.Factory` will be used instead.

      Sets `CronetDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS` as the connection timeout, `CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS` as the read timeout.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `userAgent` - The user agent that will be used by the fallback `HttpDataSource` if needed, or `null` for the fallback to use the default user agent of the underlying platform.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         int connectTimeoutMs,
                                         int readTimeoutMs,
                                         boolean resetTimeoutOnRedirects,
                                         @Nullable
                                         String userAgent)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, a `DefaultHttpDataSource.Factory` will be used instead.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `connectTimeoutMs` - The connection timeout, in milliseconds.
        `readTimeoutMs` - The read timeout, in milliseconds.
        `resetTimeoutOnRedirects` - Whether the connect timeout is reset when a redirect occurs.
        `userAgent` - The user agent that will be used by the fallback `HttpDataSource` if needed, or `null` for the fallback to use the default user agent of the underlying platform.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         int connectTimeoutMs,
                                         int readTimeoutMs,
                                         boolean resetTimeoutOnRedirects,
                                         HttpDataSource.Factory fallbackFactory)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, the provided fallback `HttpDataSource.Factory` will be used instead.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `connectTimeoutMs` - The connection timeout, in milliseconds.
        `readTimeoutMs` - The read timeout, in milliseconds.
        `resetTimeoutOnRedirects` - Whether the connect timeout is reset when a redirect occurs.
        `fallbackFactory` - A `HttpDataSource.Factory` which is used as a fallback in case no suitable CronetEngine can be build.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         @Nullable
                                         TransferListener transferListener,
                                         HttpDataSource.Factory fallbackFactory)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, the provided fallback `HttpDataSource.Factory` will be used instead.

      Sets `CronetDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS` as the connection timeout, `CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS` as the read timeout.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `transferListener` - An optional listener.
        `fallbackFactory` - A `HttpDataSource.Factory` which is used as a fallback in case no suitable CronetEngine can be build.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         @Nullable
                                         TransferListener transferListener)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, a `DefaultHttpDataSource.Factory` will be used instead.

      Sets `CronetDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS` as the connection timeout, `CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS` as the read timeout.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `transferListener` - An optional listener.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         @Nullable
                                         TransferListener transferListener,
                                         @Nullable
                                         String userAgent)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, a `DefaultHttpDataSource.Factory` will be used instead.

      Sets `CronetDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS` as the connection timeout, `CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS` as the read timeout.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `transferListener` - An optional listener.
        `userAgent` - The user agent that will be used by the fallback `HttpDataSource` if needed, or `null` for the fallback to use the default user agent of the underlying platform.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         @Nullable
                                         TransferListener transferListener,
                                         int connectTimeoutMs,
                                         int readTimeoutMs,
                                         boolean resetTimeoutOnRedirects,
                                         @Nullable
                                         String userAgent)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, a `DefaultHttpDataSource.Factory` will be used instead.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `transferListener` - An optional listener.
        `connectTimeoutMs` - The connection timeout, in milliseconds.
        `readTimeoutMs` - The read timeout, in milliseconds.
        `resetTimeoutOnRedirects` - Whether the connect timeout is reset when a redirect occurs.
        `userAgent` - The user agent that will be used by the fallback `HttpDataSource` if needed, or `null` for the fallback to use the default user agent of the underlying platform.

    - #### CronetDataSourceFactory

          public CronetDataSourceFactory​(CronetEngineWrapper cronetEngineWrapper,
                                         Executor executor,
                                         @Nullable
                                         TransferListener transferListener,
                                         int connectTimeoutMs,
                                         int readTimeoutMs,
                                         boolean resetTimeoutOnRedirects,
                                         HttpDataSource.Factory fallbackFactory)

      Deprecated.
      Creates an instance.

      If the `CronetEngineWrapper` fails to provide a `CronetEngine`, the provided fallback `HttpDataSource.Factory` will be used instead.

      Parameters:
        `cronetEngineWrapper` - A `CronetEngineWrapper`.
        `executor` - The `Executor` that will perform the requests.
        `transferListener` - An optional listener.
        `connectTimeoutMs` - The connection timeout, in milliseconds.
        `readTimeoutMs` - The read timeout, in milliseconds.
        `resetTimeoutOnRedirects` - Whether the connect timeout is reset when a redirect occurs.
        `fallbackFactory` - A `HttpDataSource.Factory` which is used as a fallback in case no suitable CronetEngine can be build.

  - ### Method Detail

    - #### createDataSourceInternal

          protected HttpDataSource 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.