Class OkHttpDataSourceFactory

  • All Implemented Interfaces:
    com.vng.android.exoplayer2.upstream.DataSource.Factory, com.vng.android.exoplayer2.upstream.HttpDataSource.Factory

    public final class OkHttpDataSourceFactory
    extends com.vng.android.exoplayer2.upstream.HttpDataSource.BaseFactory
    A HttpDataSource.Factory that produces OkHttpDataSource.
    • Constructor Detail

      • OkHttpDataSourceFactory

        public OkHttpDataSourceFactory​(okhttp3.Call.Factory callFactory,
                                       @Nullable
                                       String userAgent)
        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)
        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
                                       com.vng.android.exoplayer2.upstream.TransferListener listener)
        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
                                       com.vng.android.exoplayer2.upstream.TransferListener listener,
                                       @Nullable
                                       okhttp3.CacheControl cacheControl)
        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​(com.vng.android.exoplayer2.upstream.HttpDataSource.RequestProperties defaultRequestProperties)
        Specified by:
        createDataSourceInternal in class com.vng.android.exoplayer2.upstream.HttpDataSource.BaseFactory