From d5c2cf79f403b89cc4f79b467714e2f746898135 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 27 Jun 2017 10:11:26 -0700 Subject: [PATCH] Update READMEs with new local build instructions Issue: #2851 Issue: #2974 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=160290097 --- README.md | 38 +++++++++++++++++++++++++++++++++++++ extensions/cronet/README.md | 19 +++++++++++-------- extensions/ffmpeg/README.md | 30 ++++++----------------------- extensions/flac/README.md | 30 ++++++----------------------- extensions/gvr/README.md | 14 ++++++++++---- extensions/ima/README.md | 9 +++++++++ extensions/okhttp/README.md | 22 +++++++++------------ extensions/opus/README.md | 30 ++++++----------------------- extensions/vp9/README.md | 31 ++++++------------------------ 9 files changed, 101 insertions(+), 122 deletions(-) diff --git a/README.md b/README.md index 3de86d21a3..d7bc23f700 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,11 @@ and extend, and can be updated through Play Store application updates. ## Using ExoPlayer ## +ExoPlayer modules can be obtained via jCenter. It's also possible to clone the +repository and depend on the modules locally. + +### Via jCenter ### + The easiest way to get started using ExoPlayer is to add it as a gradle dependency. You need to make sure you have the jcenter repository included in the `build.gradle` file in the root of your project: @@ -64,6 +69,39 @@ latest versions, see the [Release notes][]. [Bintray]: https://bintray.com/google/exoplayer [Release notes]: https://github.com/google/ExoPlayer/blob/release-v2/RELEASENOTES.md +### Locally ### + +Cloning the repository and depending on the modules locally is required when +using some ExoPlayer extension modules. It's also a suitable approach if you +want to make local changes to ExoPlayer, or if you want to use a development +branch. + +First, clone the repository into a local directory and checkout the desired +branch: + +```sh +git clone https://github.com/google/ExoPlayer.git +git checkout release-v2 +``` + +Next, add the following to your project's `settings.gradle` file, replacing +`path/to/exoplayer` with the path to your local copy: + +```gradle +gradle.ext.exoplayerRoot = 'path/to/exoplayer' +gradle.ext.exoplayerModulePrefix = 'exoplayer-' +apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle') +``` + +You should now see the ExoPlayer modules appear as part of your project. You can +depend on them as you would on any other local module, for example: + +```gradle +compile project(':exoplayer-library-core') +compile project(':exoplayer-library-dash') +compile project(':exoplayer-library-ui) +``` + ## Developing ExoPlayer ## #### Project branches #### diff --git a/extensions/cronet/README.md b/extensions/cronet/README.md index a570385a52..30409fa99e 100644 --- a/extensions/cronet/README.md +++ b/extensions/cronet/README.md @@ -11,13 +11,10 @@ The Cronet Extension is an [HttpDataSource][] implementation using [Cronet][]. ## Build Instructions ## -* Checkout ExoPlayer along with Extensions: - -``` -git clone https://github.com/google/ExoPlayer.git -``` - -* Get the Cronet libraries: +To use this extension you need to clone the ExoPlayer repository and depend on +its modules locally. Instructions for doing this can be found in ExoPlayer's +[top level README][]. In addition, it's necessary to get the Cronet libraries +and enable the extension: 1. Find the latest Cronet release [here][] and navigate to its `Release/cronet` directory @@ -27,6 +24,12 @@ git clone https://github.com/google/ExoPlayer.git 1. Copy the content of the downloaded `libs` directory into the `jniLibs` directory of this extension -* In ExoPlayer's `settings.gradle` file, uncomment the Cronet extension +* In your `settings.gradle` file, add the following line before the line that + applies `core_settings.gradle`: +```gradle +gradle.ext.exoplayerIncludeCronetExtension = true; +``` + +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md [here]: https://console.cloud.google.com/storage/browser/chromium-cronet/android diff --git a/extensions/ffmpeg/README.md b/extensions/ffmpeg/README.md index 4ce9173ec9..ab3e5ffb94 100644 --- a/extensions/ffmpeg/README.md +++ b/extensions/ffmpeg/README.md @@ -9,11 +9,10 @@ audio. ## Build instructions ## -* Checkout ExoPlayer along with Extensions - -``` -git clone https://github.com/google/ExoPlayer.git -``` +To use this extension you need to clone the ExoPlayer repository and depend on +its modules locally. Instructions for doing this can be found in ExoPlayer's +[top level README][]. In addition, it's necessary to build the extension's +native components as follows: * Set the following environment variables: @@ -25,8 +24,6 @@ FFMPEG_EXT_PATH="${EXOPLAYER_ROOT}/extensions/ffmpeg/src/main" * Download the [Android NDK][] and set its location in an environment variable: -[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html - ``` NDK_PATH="" ``` @@ -106,20 +103,5 @@ cd "${FFMPEG_EXT_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI="armeabi-v7a arm64-v8a x86" -j4 ``` -* In your project, you can add a dependency on the extension by using a rule - like this: - -``` -// in settings.gradle -include ':..:ExoPlayer:library' -include ':..:ExoPlayer:extension-ffmpeg' - -// in build.gradle -dependencies { - compile project(':..:ExoPlayer:library') - compile project(':..:ExoPlayer:extension-ffmpeg') -} -``` - -* Now, when you build your app, the extension will be built and the native - libraries will be packaged along with the APK. +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md +[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html diff --git a/extensions/flac/README.md b/extensions/flac/README.md index 2f3b067d6f..a35dac7858 100644 --- a/extensions/flac/README.md +++ b/extensions/flac/README.md @@ -10,11 +10,10 @@ ExoPlayer to play Flac audio on Android devices. ## Build Instructions ## -* Checkout ExoPlayer along with Extensions: - -``` -git clone https://github.com/google/ExoPlayer.git -``` +To use this extension you need to clone the ExoPlayer repository and depend on +its modules locally. Instructions for doing this can be found in ExoPlayer's +[top level README][]. In addition, it's necessary to build the extension's +native components as follows: * Set the following environment variables: @@ -26,8 +25,6 @@ FLAC_EXT_PATH="${EXOPLAYER_ROOT}/extensions/flac/src/main" * Download the [Android NDK][] and set its location in an environment variable: -[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html - ``` NDK_PATH="" ``` @@ -47,20 +44,5 @@ cd "${FLAC_EXT_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI=all -j4 ``` -* In your project, you can add a dependency to the Flac Extension by using a - rule like this: - -``` -// in settings.gradle -include ':..:ExoPlayer:library' -include ':..:ExoPlayer:extension-flac' - -// in build.gradle -dependencies { - compile project(':..:ExoPlayer:library') - compile project(':..:ExoPlayer:extension-flac') -} -``` - -* Now, when you build your app, the Flac extension will be built and the native - libraries will be packaged along with the APK. +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md +[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html diff --git a/extensions/gvr/README.md b/extensions/gvr/README.md index bae5de4812..ad28569121 100644 --- a/extensions/gvr/README.md +++ b/extensions/gvr/README.md @@ -6,7 +6,10 @@ The GVR extension wraps the [Google VR SDK for Android][]. It provides a GvrAudioProcessor, which uses [GvrAudioSurround][] to provide binaural rendering of surround sound and ambisonic soundfields. -## Using the extension ## +[Google VR SDK for Android]: https://developers.google.com/vr/android/ +[GvrAudioSurround]: https://developers.google.com/vr/android/reference/com/google/vr/sdk/audio/GvrAudioSurround + +## Getting the extension ## The easiest way to use the extension is to add it as a gradle dependency. You need to make sure you have the jcenter repository included in the `build.gradle` @@ -27,12 +30,15 @@ compile 'com.google.android.exoplayer:extension-gvr:rX.X.X' where `rX.X.X` is the version, which must match the version of the ExoPlayer library being used. -## Using GvrAudioProcessor ## +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 ## * If using SimpleExoPlayer, override SimpleExoPlayer.buildAudioProcessors to return a GvrAudioProcessor. * If constructing renderers directly, pass a GvrAudioProcessor to MediaCodecAudioRenderer's constructor. -[Google VR SDK for Android]: https://developers.google.com/vr/android/ -[GvrAudioSurround]: https://developers.google.com/vr/android/reference/com/google/vr/sdk/audio/GvrAudioSurround +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md diff --git a/extensions/ima/README.md b/extensions/ima/README.md index aabe84136f..aaae44edcf 100644 --- a/extensions/ima/README.md +++ b/extensions/ima/README.md @@ -9,6 +9,14 @@ alongside content. [IMA]: https://developers.google.com/interactive-media-ads/docs/sdks/android/ [MediaSource]: https://github.com/google/ExoPlayer/blob/release-v2/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSource.java +## Getting the extension ## + +To use this extension you need to clone the ExoPlayer repository and depend on +its modules locally. Instructions for doing this can be found in ExoPlayer's +[top level README][]. + +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md + ## Using the extension ## Pass a single-window content `MediaSource` to `ImaAdsMediaSource`'s constructor, @@ -21,6 +29,7 @@ select and build one of the `withExtensions` build variants of the demo app in Android Studio. You can find IMA test content in the "IMA sample ad tags" section of the app. +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md [sample ad tags]: https://developers.google.com/interactive-media-ads/docs/sdks/android/tags ## Known issues ## diff --git a/extensions/okhttp/README.md b/extensions/okhttp/README.md index d84dcb44ec..52d5fabf38 100644 --- a/extensions/okhttp/README.md +++ b/extensions/okhttp/README.md @@ -5,19 +5,12 @@ The OkHttp Extension is an [HttpDataSource][] implementation using Square's [OkHttp][]. -## Using the extension ## +[HttpDataSource]: https://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/upstream/HttpDataSource.html +[OkHttp]: https://square.github.io/okhttp/ -The easiest way to use the extension is to add it as a gradle dependency. You -need to make sure you have the jcenter repository included in the `build.gradle` -file in the root of your project: +## Getting the extension ## -```gradle -repositories { - jcenter() -} -``` - -Next, include the following in your module's `build.gradle` file: +The easiest way to use the extension is to add it as a gradle dependency: ```gradle compile 'com.google.android.exoplayer:extension-okhttp:rX.X.X' @@ -26,5 +19,8 @@ compile 'com.google.android.exoplayer:extension-okhttp:rX.X.X' where `rX.X.X` is the version, which must match the version of the ExoPlayer library being used. -[HttpDataSource]: https://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/upstream/HttpDataSource.html -[OkHttp]: https://square.github.io/okhttp/ +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][]. + +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md diff --git a/extensions/opus/README.md b/extensions/opus/README.md index 36ca2b7261..ae42a9c310 100644 --- a/extensions/opus/README.md +++ b/extensions/opus/README.md @@ -10,11 +10,10 @@ ExoPlayer to play Opus audio on Android devices. ## Build Instructions ## -* Checkout ExoPlayer along with Extensions: - -``` -git clone https://github.com/google/ExoPlayer.git -``` +To use this extension you need to clone the ExoPlayer repository and depend on +its modules locally. Instructions for doing this can be found in ExoPlayer's +[top level README][]. In addition, it's necessary to build the extension's +native components as follows: * Set the following environment variables: @@ -26,8 +25,6 @@ OPUS_EXT_PATH="${EXOPLAYER_ROOT}/extensions/opus/src/main" * Download the [Android NDK][] and set its location in an environment variable: -[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html - ``` NDK_PATH="" ``` @@ -52,23 +49,8 @@ cd "${OPUS_EXT_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI=all -j4 ``` -* In your project, you can add a dependency to the Opus Extension by using a -rule like this: - -``` -// in settings.gradle -include ':..:ExoPlayer:library' -include ':..:ExoPlayer:extension-opus' - -// in build.gradle -dependencies { - compile project(':..:ExoPlayer:library') - compile project(':..:ExoPlayer:extension-opus') -} -``` - -* Now, when you build your app, the Opus extension will be built and the native - libraries will be packaged along with the APK. +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md +[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html ## Notes ## diff --git a/extensions/vp9/README.md b/extensions/vp9/README.md index 53ef4b0bfd..8bdfe652e6 100644 --- a/extensions/vp9/README.md +++ b/extensions/vp9/README.md @@ -10,11 +10,10 @@ VP9 video on Android devices. ## Build Instructions ## -* Checkout ExoPlayer along with Extensions: - -``` -git clone https://github.com/google/ExoPlayer.git -``` +To use this extension you need to clone the ExoPlayer repository and depend on +its modules locally. Instructions for doing this can be found in ExoPlayer's +[top level README][]. In addition, it's necessary to build the extension's +native components as follows: * Set the following environment variables: @@ -26,8 +25,6 @@ VP9_EXT_PATH="${EXOPLAYER_ROOT}/extensions/vp9/src/main" * Download the [Android NDK][] and set its location in an environment variable: -[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html - ``` NDK_PATH="" ``` @@ -66,23 +63,8 @@ cd "${VP9_EXT_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI=all -j4 ``` -* In your project, you can add a dependency to the VP9 Extension by using a the - following rule: - -``` -// in settings.gradle -include ':..:ExoPlayer:library' -include ':..:ExoPlayer:extension-vp9' - -// in build.gradle -dependencies { - compile project(':..:ExoPlayer:library') - compile project(':..:ExoPlayer:extension-vp9') -} -``` - -* Now, when you build your app, the VP9 extension will be built and the native - libraries will be packaged along with the APK. +[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md +[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html ## Notes ## @@ -94,4 +76,3 @@ dependencies { `${VP9_EXT_PATH}/jni/libvpx` or `${VP9_EXT_PATH}/jni/libyuv` respectively. But please note that `generate_libvpx_android_configs.sh` and the makefiles need to be modified to work with arbitrary versions of libvpx and libyuv. -