olly 2f91c12f56 Drop prefix test- from test methods under v2/extensions
This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300530329
2020-03-19 00:46:24 +00:00
..

ExoPlayer Cronet extension

The Cronet extension is an HttpDataSource implementation using Cronet.

Getting the extension

The easiest way to use the extension is to add it as a gradle dependency:

implementation 'com.google.android.exoplayer:extension-cronet:2.X.X'

where 2.X.X is the version, which must match the version of the ExoPlayer library being used.

Alternatively, you can clone the ExoPlayer repository and depend on the module locally. Instructions for doing this can be found in ExoPlayer's top level README.

Using the extension

ExoPlayer requests data through DataSource instances. These instances are either instantiated and injected from application code, or obtained from instances of DataSource.Factory that are instantiated and injected from application code.

If your application only needs to play http(s) content, using the Cronet extension is as simple as updating any DataSources and DataSource.Factory instantiations in your application code to use CronetDataSource and CronetDataSourceFactory respectively. If your application also needs to play non-http(s) content such as local files, use

new DefaultDataSource(
    ...
    new CronetDataSource(...) /* baseDataSource argument */);

and

new DefaultDataSourceFactory(
    ...
    new CronetDataSourceFactory(...) /* baseDataSourceFactory argument */);

respectively.

  • Javadoc: Classes matching com.google.android.exoplayer2.ext.cronet.* belong to this module.