public interface

HttpDataSource.Factory

implements DataSource.Factory

 androidx.media3.datasource.HttpDataSource.Factory

Subclasses:

HttpDataSource.BaseFactory, DefaultHttpDataSource.Factory, HttpEngineDataSource.Factory, OkHttpDataSource.Factory, OkHttpDataSourceFactory, CronetDataSourceFactory, CronetDataSource.Factory

Overview

A factory for HttpDataSource instances.

Summary

Methods
public HttpDataSourcecreateDataSource()

public HttpDataSource.FactorysetDefaultRequestProperties(java.util.Map<java.lang.String, java.lang.String> defaultRequestProperties)

Sets the default request headers for HttpDataSource instances created by the factory.

Methods

public HttpDataSource createDataSource()

public HttpDataSource.Factory setDefaultRequestProperties(java.util.Map<java.lang.String, java.lang.String> defaultRequestProperties)

Sets the default request headers for HttpDataSource instances created by the factory.

The new request properties will be used for future requests made by HttpDataSources created by the factory, including instances that have already been created. Modifying the defaultRequestProperties map after a call to this method will have no effect, and so it's necessary to call this method again each time the request properties need to be updated.

Parameters:

defaultRequestProperties: The default request properties.

Returns:

This factory.