Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/5.0.0 #1683

Merged
merged 11 commits into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
48 changes: 32 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<details>
<summary>iOS</summary>
<summary>iOS details</summary>

### 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).

Expand All @@ -73,8 +74,9 @@ end

</details>

<details>
<summary>tvOS</summary>
### tvOS
<details>
<summary>tvOS details</summary>

`react-native link react-native-video` doesn’t work properly with the tvOS target so we need to add the library manually.

Expand All @@ -95,14 +97,15 @@ Select RCTVideo-tvOS
<img src="./docs/tvOS-step-4.jpg" width="40%">
</details>

### Android
<details>
<summary>Android</summary>
<summary>Android details</summary>

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.

Expand All @@ -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')
Expand All @@ -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:

Expand All @@ -151,12 +165,13 @@ protected List<ReactPackage> getPackages() {
```
</details>

### Windows
<details>
<summary>Windows</summary>
<summary>Windows details</summary>

Make the following additions to the given files manually:

**windows/myapp.sln**
#### **windows/myapp.sln**

Add the `ReactNativeVideo` project to your solution.

Expand All @@ -165,15 +180,15 @@ 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:

1. Right-click main application project > Add > Reference...
* 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
Expand All @@ -200,12 +215,13 @@ using System.Collections.Generic;
```
</details>

### react-native-dom
<details>
<summary>react-native-dom</summary>
<summary>react-native-dom details</summary>

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:

Expand Down
6 changes: 3 additions & 3 deletions android-exoplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 1 addition & 4 deletions examples/basic/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
matchingFallbacks = ['release', 'debug']
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactVideoPackage()
);
new ReactVideoPackage()
);
}
};

Expand Down
4 changes: 1 addition & 3 deletions examples/basic/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ buildscript {
allprojects {
repositories {
mavenLocal()
maven {
url 'https://maven.google.com'
}
google()
maven {
url "https://jitpack.io"
}
Expand Down
4 changes: 0 additions & 4 deletions examples/basic/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-video",
"version": "4.4.3",
"version": "5.0.0",
"description": "A <Video /> element for react-native",
"main": "Video.js",
"license": "MIT",
Expand Down Expand Up @@ -45,11 +45,6 @@
"scripts": {
"test": "node_modules/.bin/eslint *.js"
},
"rnpm": {
"android": {
"sourceDir": "./android-exoplayer"
}
},
"files": [
"android-exoplayer",
"android",
Expand Down