feat(android): allow building exoplayer from source (#3932)

* feat(android): allow to build from source code

* fix(android): allow to build plugin from source
This commit is contained in:
Olivier Bouillet
2024-06-25 13:20:12 +02:00
committed by GitHub
parent 91d27a6009
commit a7d834a80a
7 changed files with 127 additions and 21 deletions

View File

@@ -81,12 +81,20 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion
namespace "com.videoplayer"
compileOptions {
// These options are necessary to be able to build fro source
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
defaultConfig {
applicationId "com.videoplayer"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
signingConfigs {
debug {
@@ -147,6 +155,8 @@ dependencies {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
// coreLibraryDesugaring is mandatory to be able to build exoplayer from source
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

View File

@@ -16,6 +16,9 @@ buildscript {
// useExoplayerSmoothStreaming = false
// useExoplayerDash = false
// useExoplayerHls = false
// uncomment this line to be able to build from media3 source code
// buildFromMedia3Source = true
}
repositories {
google()

View File

@@ -8,6 +8,10 @@ project (':react-native-video-plugin-sample').projectDir = new File(rootProject.
include ':react-native-video'
project (':react-native-video').projectDir = new File(rootProject.projectDir, '../../../android')
// uncomment these lines to be able to build from media3 source code
// gradle.ext.androidxMediaModulePrefix = 'media-'
// apply from: file("../../../../media3/core_settings.gradle")
includeBuild('../node_modules/@react-native/gradle-plugin')
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")