Back to Exoplayer

CronetDataSourceFactory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/ext/cronet/CronetDataSourceFactory.html

latest23.9 KB
Original Source

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

Class CronetDataSourceFactory


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classCronetDataSourceFactoryextends[HttpDataSource.BaseFactory](../../upstream/HttpDataSource.BaseFactory.html "class in com.google.android.exoplayer2.upstream")

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, 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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,[HttpDataSource.Factory](../../upstream/HttpDataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               int connectTimeoutMs,
                               int readTimeoutMs,
                               boolean resetTimeoutOnRedirects,
                               @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               int connectTimeoutMs,
                               int readTimeoutMs,
                               boolean resetTimeoutOnRedirects,[HttpDataSource.Factory](../../upstream/HttpDataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               @Nullable[TransferListener](../../upstream/TransferListener.html "interface in com.google.android.exoplayer2.upstream")transferListener,[HttpDataSource.Factory](../../upstream/HttpDataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               @Nullable[TransferListener](../../upstream/TransferListener.html "interface in com.google.android.exoplayer2.upstream")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               @Nullable[TransferListener](../../upstream/TransferListener.html "interface in com.google.android.exoplayer2.upstream")transferListener,
                               @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               @Nullable[TransferListener](../../upstream/TransferListener.html "interface in com.google.android.exoplayer2.upstream")transferListener,
                               int connectTimeoutMs,
                               int readTimeoutMs,
                               boolean resetTimeoutOnRedirects,
                               @Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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.html "class in com.google.android.exoplayer2.ext.cronet")cronetEngineWrapper,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor,
                               @Nullable[TransferListener](../../upstream/TransferListener.html "interface in com.google.android.exoplayer2.upstream")transferListener,
                               int connectTimeoutMs,
                               int readTimeoutMs,
                               boolean resetTimeoutOnRedirects,[HttpDataSource.Factory](../../upstream/HttpDataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")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](../../upstream/HttpDataSource.html "interface in com.google.android.exoplayer2.upstream")createDataSourceInternal​([HttpDataSource.RequestProperties](../../upstream/HttpDataSource.RequestProperties.html "class in com.google.android.exoplayer2.upstream")defaultRequestProperties)

Deprecated.

Description copied from class: HttpDataSource.BaseFactory

Called by HttpDataSource.BaseFactory.createDataSource() to create a HttpDataSource instance. Specified by:createDataSourceInternal in class HttpDataSource.BaseFactoryParameters:defaultRequestProperties - The default RequestProperties to be used by the HttpDataSource instance.Returns:A HttpDataSource instance.