diff --git a/CHANGELOG.md b/CHANGELOG.md index dada084585..48f1b80516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## Changelog -### next +### Version 5.0.0 +* AndroidX Support + +### Version 4.4.4 * Handle racing conditions when props are setted on exoplayer ### Version 4.4.3 diff --git a/README.md b/README.md index 6b26cb40e6..2c40b188e5 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,15 @@ yarn add react-native-video Then follow the instructions for your platform to link react-native-video into your project: +### iOS
- iOS + iOS details -### Standard Method +#### Standard Method Run `react-native link react-native-video` to link the react-native-video library. -### Using CocoaPods (required to enable caching) +#### Using CocoaPods (required to enable caching) Setup your Podfile like it is described in the [react-native documentation](https://facebook.github.io/react-native/docs/integration-with-existing-apps#configuring-cocoapods-dependencies). @@ -73,8 +74,9 @@ end
-
- tvOS +### tvOS +
+ tvOS details `react-native link react-native-video` doesn’t work properly with the tvOS target so we need to add the library manually. @@ -95,14 +97,15 @@ Select RCTVideo-tvOS
+### Android
- Android + Android details Run `react-native link react-native-video` to link the react-native-video library. Or if you have trouble, make the following additions to the given files manually: -**android/settings.gradle** +#### **android/settings.gradle** The newer ExoPlayer library will work for most people. @@ -119,9 +122,11 @@ project(':react-native-video').projectDir = new File(rootProject.projectDir, '.. ``` -**android/app/build.gradle** +#### **android/app/build.gradle** -```gradle +From version >= 5.0.0, you have to apply this changes: + +```diff dependencies { ... compile project(':react-native-video') @@ -130,7 +135,16 @@ dependencies { } ``` -**MainApplication.java** +#### **android/gradle.properties** + +Migrating to AndroidX (needs version >= 5.0.0): + +```gradle.properties +android.useAndroidX=true +android.enableJetifier=true +``` + +#### **MainApplication.java** On top, where imports are: @@ -151,12 +165,13 @@ protected List getPackages() { ```
+### Windows
- Windows + Windows details Make the following additions to the given files manually: -**windows/myapp.sln** +#### **windows/myapp.sln** Add the `ReactNativeVideo` project to your solution. @@ -165,7 +180,7 @@ Add the `ReactNativeVideo` project to your solution. * UWP: Select `node_modules\react-native-video\windows\ReactNativeVideo\ReactNativeVideo.csproj` * WPF: Select `node_modules\react-native-video\windows\ReactNativeVideo.Net46\ReactNativeVideo.Net46.csproj` -**windows/myapp/myapp.csproj** +#### **windows/myapp/myapp.csproj** Add a reference to `ReactNativeVideo` to your main application project. From Visual Studio 2015: @@ -173,7 +188,7 @@ Add a reference to `ReactNativeVideo` to your main application project. From Vis * UWP: Check `ReactNativeVideo` from Solution Projects. * WPF: Check `ReactNativeVideo.Net46` from Solution Projects. -**MainPage.cs** +#### **MainPage.cs** Add the `ReactVideoPackage` class to your list of exported packages. ```cs @@ -200,12 +215,13 @@ using System.Collections.Generic; ```
+### react-native-dom
- react-native-dom + react-native-dom details Make the following additions to the given files manually: -**dom/bootstrap.js** +#### **dom/bootstrap.js** Import RCTVideoManager and add it to the list of nativeModules: diff --git a/android-exoplayer/build.gradle b/android-exoplayer/build.gradle index c2010d020c..5baf953a22 100644 --- a/android-exoplayer/build.gradle +++ b/android-exoplayer/build.gradle @@ -28,9 +28,9 @@ dependencies { } // All support libs must use the same version - implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '28.0.0')}" - implementation "com.android.support:support-compat:${safeExtGet('supportLibVersion', '28.0.0')}" - implementation "com.android.support:support-media-compat:${safeExtGet('supportLibVersion', '28.0.0')}" + implementation "androidx.annotation:annotation:1.0.0" + implementation "androidx.core:core:1.0.0" + implementation "androidx.media:media:1.0.0" implementation('com.google.android.exoplayer:extension-okhttp:2.9.3') { exclude group: 'com.squareup.okhttp3', module: 'okhttp' diff --git a/examples/basic/android/app/build.gradle b/examples/basic/android/app/build.gradle index f36650bebb..915e4eca61 100644 --- a/examples/basic/android/app/build.gradle +++ b/examples/basic/android/app/build.gradle @@ -111,7 +111,6 @@ android { release { signingConfig signingConfigs.debug minifyEnabled enableProguardInReleaseBuilds - matchingFallbacks = ['release', 'debug'] proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } @@ -132,10 +131,8 @@ android { dependencies { implementation project(':react-native-video') - compile "com.android.support:appcompat-v7:28.0.0" - implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" + implementation "androidx.appcompat:appcompat:1.0.0" implementation "com.facebook.react:react-native:+" // From node_modules -// compile project(':react-native-video-exoplayer') // uncomment to use exoplayer } // Run this once to be able to run the application with BUCK diff --git a/examples/basic/android/app/src/main/java/com/videoplayer/MainApplication.java b/examples/basic/android/app/src/main/java/com/videoplayer/MainApplication.java index e9f6432264..a269841570 100644 --- a/examples/basic/android/app/src/main/java/com/videoplayer/MainApplication.java +++ b/examples/basic/android/app/src/main/java/com/videoplayer/MainApplication.java @@ -24,8 +24,8 @@ public boolean getUseDeveloperSupport() { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new ReactVideoPackage() - ); + new ReactVideoPackage() + ); } }; diff --git a/examples/basic/android/build.gradle b/examples/basic/android/build.gradle index 3161c39de4..5e5d6decd1 100644 --- a/examples/basic/android/build.gradle +++ b/examples/basic/android/build.gradle @@ -24,9 +24,7 @@ buildscript { allprojects { repositories { mavenLocal() - maven { - url 'https://maven.google.com' - } + google() maven { url "https://jitpack.io" } diff --git a/examples/basic/android/settings.gradle b/examples/basic/android/settings.gradle index 1675ef5ec6..5fc7fca440 100644 --- a/examples/basic/android/settings.gradle +++ b/examples/basic/android/settings.gradle @@ -3,8 +3,4 @@ rootProject.name = 'VideoPlayer' include ':react-native-video' project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer') -// Quick Local Development -//project(':react-native-video').projectDir = new File(rootProject.projectDir, '../../android') -//project(':react-native-video-exoplayer').projectDir = new File(rootProject.projectDir, '../../android-exoplayer') - include ':app' diff --git a/package.json b/package.json index c878ba45ef..3b2c58e233 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-video", - "version": "4.4.3", + "version": "5.0.0", "description": "A