public final class OkHttpDataSourceFactory
extends com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory
HttpDataSource.Factory that produces OkHttpDataSource.| Constructor and Description |
|---|
OkHttpDataSourceFactory(okhttp3.Call.Factory callFactory,
java.lang.String userAgent,
com.google.android.exoplayer2.upstream.TransferListener<? super com.google.android.exoplayer2.upstream.DataSource> listener) |
OkHttpDataSourceFactory(okhttp3.Call.Factory callFactory,
java.lang.String userAgent,
com.google.android.exoplayer2.upstream.TransferListener<? super com.google.android.exoplayer2.upstream.DataSource> listener,
okhttp3.CacheControl cacheControl) |
| Modifier and Type | Method and Description |
|---|---|
protected OkHttpDataSource |
createDataSourceInternal(com.google.android.exoplayer2.upstream.HttpDataSource.RequestProperties defaultRequestProperties) |
public OkHttpDataSourceFactory(@NonNull
okhttp3.Call.Factory callFactory,
@Nullable
java.lang.String userAgent,
@Nullable
com.google.android.exoplayer2.upstream.TransferListener<? super com.google.android.exoplayer2.upstream.DataSource> listener)
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.public OkHttpDataSourceFactory(@NonNull
okhttp3.Call.Factory callFactory,
@Nullable
java.lang.String userAgent,
@Nullable
com.google.android.exoplayer2.upstream.TransferListener<? super com.google.android.exoplayer2.upstream.DataSource> listener,
@Nullable
okhttp3.CacheControl cacheControl)
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.protected OkHttpDataSource createDataSourceInternal(com.google.android.exoplayer2.upstream.HttpDataSource.RequestProperties defaultRequestProperties)
createDataSourceInternal in class com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory