react-native-video/android-exoplayer/build.gradle

48 lines
1.4 KiB
Groovy
Raw Normal View History

2017-01-11 05:51:45 -07:00
apply plugin: 'com.android.library'
2018-07-24 14:19:45 -06:00
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
2017-01-11 05:51:45 -07:00
android {
2019-06-19 01:37:21 -06:00
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
2017-01-11 05:51:45 -07:00
defaultConfig {
2018-07-24 14:19:45 -06:00
minSdkVersion safeExtGet('minSdkVersion', 16)
2019-06-19 01:37:21 -06:00
targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1
versionName "1.0"
2017-01-11 05:51:45 -07:00
}
Add iOS and Android basic DRM support (#1445) This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey) I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR. **Test stream for ANDROID:** ``` testStream = { uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)', type: 'mpd', drm: { type: DRMType.PLAYREADY, licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)' } }; ``` or ``` { uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd', drm: { type: 'widevine', //or DRMType.WIDEVINE licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense', headers: { 'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU' }, } } ``` **Test stream for iOS:** Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them. It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
2020-08-12 19:56:21 -06:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2017-01-11 05:51:45 -07:00
}
dependencies {
2019-05-24 03:03:38 -06:00
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
2020-06-11 07:17:33 -06:00
implementation('com.google.android.exoplayer:exoplayer:2.11.4') {
exclude group: 'com.android.support'
}
2018-08-08 00:10:03 -06:00
// All support libs must use the same version
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.core:core:1.1.0"
implementation "androidx.media:media:1.1.0"
2018-08-08 00:10:03 -06:00
2020-06-11 07:17:33 -06:00
implementation('com.google.android.exoplayer:extension-okhttp:2.11.4') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
implementation 'com.google.android.exoplayer:extension-ima:2.11.4'
implementation 'com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}'
2018-08-08 00:10:03 -06:00
}