Class DefaultDataSourceFactory

    • Constructor Detail

      • DefaultDataSourceFactory

        public DefaultDataSourceFactory​(@NonNull
                                        Context context)
      • DefaultDataSourceFactory

        public DefaultDataSourceFactory​(@NonNull
                                        Context context,
                                        @Nullable
                                        com.google.android.exoplayer2.upstream.TransferListener transferListener)
      • DefaultDataSourceFactory

        public DefaultDataSourceFactory​(@NonNull
                                        Context context,
                                        @Nullable
                                        com.google.android.exoplayer2.upstream.TransferListener transferListener,
                                        @Nullable
                                        HttpListener httpListener,
                                        @Nullable
                                        PlayerController playerController)
    • Method Detail

      • createDataSource

        @NonNull
        public com.google.android.exoplayer2.upstream.DataSource createDataSource()
        Specified by:
        createDataSource in interface com.google.android.exoplayer2.upstream.DataSource.Factory
      • createDataSource

        public com.google.android.exoplayer2.upstream.DataSource createDataSource​(int requestType)
        Description copied from interface: DataSourceFactory
        Creates a data source for the given request type
        Specified by:
        createDataSource in interface DataSourceFactory
        Parameters:
        requestType - The request type
        Returns:
        dataSource the data source
      • addHeaderParameter

        public void addHeaderParameter​(@NonNull
                                       String key,
                                       @Nullable
                                       String value)
        Description copied from interface: DataSourceFactory
        Adds a header parameter that will be added to each HTTP connection header that is generated with a DataSource created by this factory.

        Note that you will need to call this before a call to DataSource.Factory.createDataSource() in order to successfully add the parameter.

        Specified by:
        addHeaderParameter in interface DataSourceFactory
        Parameters:
        key - the key
        value - the value or null to remove any previously added endtry with the given key
      • addQueryParameter

        public void addQueryParameter​(@NonNull
                                      String key,
                                      @Nullable
                                      String value)
        Description copied from interface: DataSourceFactory
        Adds a query parameter that will be appended to each HTTP URL.

        Note that you will need to call this before a call to DataSource.Factory.createDataSource() in order to successfully add the parameter.

        Specified by:
        addQueryParameter in interface DataSourceFactory
        Parameters:
        key - the key
        value - the value or null to remove any previously added entry with the given key