Update README.md

Make installation parts easier to link
This commit is contained in:
Daniel Mariño Ruiz 2019-07-23 11:29:50 +02:00 committed by GitHub
parent 47e1630679
commit 95060d7bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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).
@ -73,8 +74,9 @@ end
</details>
<details>
<summary>tvOS</summary>
### tvOS
<details>
<summary>tvOS Detiails</summary>
`react-native link react-native-video` doesnt work properly with the tvOS target so we need to add the library manually.
@ -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.
@ -119,7 +122,7 @@ project(':react-native-video').projectDir = new File(rootProject.projectDir, '..
```
**android/app/build.gradle**
#### **android/app/build.gradle**
```gradle
dependencies {
@ -130,7 +133,7 @@ dependencies {
}
```
**android/gradle.properties**
#### **android/gradle.properties**
Migrating to AndroidX:
@ -139,7 +142,7 @@ android.useAndroidX=true
android.enableJetifier=true
```
**MainApplication.java**
#### **MainApplication.java**
On top, where imports are:
@ -160,12 +163,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.
@ -174,7 +178,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:
@ -182,7 +186,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
@ -209,12 +213,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: