Align README and helloworld documentation

#minor-release

PiperOrigin-RevId: 377269770
This commit is contained in:
olly 2021-06-03 13:45:57 +01:00 committed by bachinger
parent e99ca16176
commit 271011c6f9
2 changed files with 24 additions and 27 deletions

View File

@ -25,6 +25,8 @@ and extend, and can be updated through Play Store application updates.
ExoPlayer modules can be obtained from [the Google Maven repository][]. It's ExoPlayer modules can be obtained from [the Google Maven repository][]. It's
also possible to clone the repository and depend on the modules locally. also possible to clone the repository and depend on the modules locally.
[the Google Maven repository]: https://developer.android.com/studio/build/dependencies#google-maven
### From the Google Maven repository ### From the Google Maven repository
#### 1. Add ExoPlayer module dependencies #### #### 1. Add ExoPlayer module dependencies ####
@ -39,13 +41,10 @@ implementation 'com.google.android.exoplayer:exoplayer:2.X.X'
where `2.X.X` is your preferred version. where `2.X.X` is your preferred version.
Note: old versions of ExoPlayer are available via JCenter. To use them, you need
to add `jcenter()` to your project's root build.gradle `repositories` block.
As an alternative to the full library, you can depend on only the library As an alternative to the full library, you can depend on only the library
modules that you actually need. For example the following will add dependencies modules that you actually need. For example the following will add dependencies
on the Core, DASH and UI library modules, as might be required for an app that on the Core, DASH and UI library modules, as might be required for an app that
plays DASH content: only plays DASH content:
```gradle ```gradle
implementation 'com.google.android.exoplayer:exoplayer-core:2.X.X' implementation 'com.google.android.exoplayer:exoplayer-core:2.X.X'
@ -54,13 +53,15 @@ implementation 'com.google.android.exoplayer:exoplayer-ui:2.X.X'
``` ```
The available library modules are listed below. Adding a dependency to the full The available library modules are listed below. Adding a dependency to the full
library is equivalent to adding dependencies on all of the library modules ExoPlayer library is equivalent to adding dependencies on all of the library
individually. modules individually.
* `exoplayer-core`: Core functionality (required). * `exoplayer-core`: Core functionality (required).
* `exoplayer-dash`: Support for DASH content. * `exoplayer-dash`: Support for DASH content.
* `exoplayer-hls`: Support for HLS content. * `exoplayer-hls`: Support for HLS content.
* `exoplayer-rtsp`: Support for RTSP content.
* `exoplayer-smoothstreaming`: Support for SmoothStreaming content. * `exoplayer-smoothstreaming`: Support for SmoothStreaming content.
* `exoplayer-transformer`: Media transformation functionality.
* `exoplayer-ui`: UI components and resources for use with ExoPlayer. * `exoplayer-ui`: UI components and resources for use with ExoPlayer.
In addition to library modules, ExoPlayer has extension modules that depend on In addition to library modules, ExoPlayer has extension modules that depend on
@ -72,7 +73,6 @@ More information on the library and extension modules that are available can be
found on the [Google Maven ExoPlayer page][]. found on the [Google Maven ExoPlayer page][].
[extensions directory]: https://github.com/google/ExoPlayer/tree/release-v2/extensions/ [extensions directory]: https://github.com/google/ExoPlayer/tree/release-v2/extensions/
[the Google Maven repository]: https://developer.android.com/studio/build/dependencies#google-maven
[Google Maven ExoPlayer page]: https://maven.google.com/web/index.html#com.google.android.exoplayer [Google Maven ExoPlayer page]: https://maven.google.com/web/index.html#com.google.android.exoplayer
#### 2. Turn on Java 8 support #### #### 2. Turn on Java 8 support ####
@ -87,6 +87,12 @@ compileOptions {
} }
``` ```
#### 3. Enable multidex ####
If your Gradle `minSdkVersion` is 20 or lower, you should
[enable multidex](https://developer.android.com/studio/build/multidex) in order
to prevent build errors.
### Locally ### ### Locally ###
Cloning the repository and depending on the modules locally is required when Cloning the repository and depending on the modules locally is required when

View File

@ -24,24 +24,11 @@ These steps are described in more detail below. For a complete example, refer to
## Adding ExoPlayer as a dependency ## ## Adding ExoPlayer as a dependency ##
### Add repositories ###
The first step to getting started is to make sure you have the Google and
JCenter repositories included in the `build.gradle` file in the root of your
project.
~~~
repositories {
google()
jcenter()
}
~~~
{: .language-gradle}
### Add ExoPlayer modules ### ### Add ExoPlayer modules ###
Next add a dependency in the `build.gradle` file of your app module. The The easiest way to get started using ExoPlayer is to add it as a gradle
following will add a dependency to the full ExoPlayer library: dependency in the `build.gradle` file of your app module. The following will add
a dependency to the full library:
~~~ ~~~
implementation 'com.google.android.exoplayer:exoplayer:2.X.X' implementation 'com.google.android.exoplayer:exoplayer:2.X.X'
@ -75,9 +62,13 @@ modules individually.
* `exoplayer-transformer`: Media transformation functionality. * `exoplayer-transformer`: Media transformation functionality.
* `exoplayer-ui`: UI components and resources for use with ExoPlayer. * `exoplayer-ui`: UI components and resources for use with ExoPlayer.
In addition to library modules, ExoPlayer has multiple extension modules that In addition to library modules, ExoPlayer has extension modules that depend on
depend on external libraries to provide additional functionality. Browse the external libraries to provide additional functionality. Some extensions are
[extensions directory][] and their individual READMEs for details. available from the Maven repository, whereas others must be built manually.
Browse the [extensions directory][] and their individual READMEs for details.
More information on the library and extension modules that are available can be
found on the [Google Maven ExoPlayer page][].
### Turn on Java 8 support ### ### Turn on Java 8 support ###
@ -239,4 +230,4 @@ can be done by calling `ExoPlayer.release`.
[Playlists page]: {{ site.baseurl }}/playlists.html [Playlists page]: {{ site.baseurl }}/playlists.html
[Media items page]: {{ site.baseurl }}/media-items.html [Media items page]: {{ site.baseurl }}/media-items.html
[Media sources page]: {{ site.baseurl }}/media-sources.html [Media sources page]: {{ site.baseurl }}/media-sources.html
[Google Maven ExoPlayer page]: https://maven.google.com/web/index.html#com.google.android.exoplayer