Skip to content

Commit

Permalink
Merge pull request #3 from react-native-community/master
Browse files Browse the repository at this point in the history
Merge from master
  • Loading branch information
sridhard authored Oct 2, 2019
2 parents 3c6ecfb + b97663e commit 01f37c5
Show file tree
Hide file tree
Showing 31 changed files with 3,422 additions and 2,627 deletions.
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

# Bug

<!--
Please provide a clear and concise description of what the bug is.
Include screenshots if needed.
Please test using the latest release of the library, as maybe said bug has been already fixed.
If the library has multiple install methods, describe installation method (e.g., pod, not pod, with jetifier etc)
-->

## Platform
<!--
Platform where your bug is happening. If Android, report if using Android or Android Exoplayer
-->
Which player are you experiencing the problem on:
* iOS
* Android ExoPlayer
* Android MediaPlayer
* Windows UWP
* Windows WPF

## Environment info

<!--
Run `react-native info` in your terminal and copy the results here. Also, include the *precise* version number of this library that you are using in the project
-->

React native info output:

```bash
// paste it here
```

Library version: x.x.x

## Steps To Reproduce

<!--
Issues without reproduction steps or code are likely to stall.
-->

1.
2.
...

## Expected behaviour

1.
2.

## Reproducible sample code

<!--
Please add to your issue a repro, a fresh codebase with the minimal changes so that the bug can be tested in isolation
-->

## Video sample
If possible, include a link to the video that has the problem that can be streamed or downloaded from.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

# Feature Request

<!--
This issue should serve for you to present or pitch an idea to the maintainers - but remember that it would be better if you were to submit a PR instead 🤗
-->

## Why it is needed

<!--
Please tell us a bit more of why you want this feature to be added, what's its origin
-->

## Possible implementation

<!--
It really helps if you could describe from a technical POV how this new feature would work, which code it rely on, etc
-->

### Code sample

<!--
Please show how the new code could work, if doable
-->
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
## Changelog

### next
### Version 5.1.0-alpha1
* Fixed Exoplayer doesn't work with mute=true (Android). [#1696](https://github.com/react-native-community/react-native-video/pull/1696)
* Added support for automaticallyWaitsToMinimizeStalling property (iOS) [#1723](https://github.com/react-native-community/react-native-video/pull/1723)
* Bump Exoplayer to 2.10.4, remove deprecated usages of Exoplayer methods (Android). [#1753](https://github.com/react-native-community/react-native-video/pull/1753)
* Preserve Exoplayer BandwidthMeter instance across video plays, this should noticeably improve streaming bandwidth detection (Android).

### Version 5.0.2
* Fix crash when RCTVideo's superclass doesn't observe the keyPath 'frame' (iOS) [#1720](https://github.com/react-native-community/react-native-video/pull/1720)

### Version 5.0.1
* Fix AndroidX Support bad merge

### Version 5.0.0 [Deprecated]
* AndroidX Support

### Version 4.4.4
* Handle racing conditions when props are setted on exoplayer

### Version 4.4.3
Expand Down
116 changes: 95 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
A `<Video>` component for react-native, as seen in
[react-native-login](https://github.com/brentvatne/react-native-login)!

Version 5.x recommends react-native >= 0.60.0 for Android 64bit builds and Android X support.

Version 4.x requires react-native >= 0.57.0

Version 3.x requires react-native >= 0.40.0

### Version 5.0.0 breaking changes

Version 5 introduces breaking changes on Android, please check carefully the steps described there: [Android Installation](#Android-installation)

### Version 4.0.0 breaking changes
Version 4.0.0 changes some behaviors and may require updates to your Gradle files. See [Updating](#updating) for details.

Expand All @@ -20,6 +26,11 @@ Version 3.0 features a number of changes to existing behavior. See [Updating](#u
## Table of Contents

* [Installation](#installation)
* [iOS](#ios-installation)
* [tvOS](#tvos-installation)
* [Android](#android-installation)
* [Windows](#windows-installation)
* [react-native-dom](#react-native-dom-installation)
* [Usage](#usage)
* [iOS App Transport Security](#ios-app-transport-security)
* [Audio Mixing](#audio-mixing)
Expand All @@ -42,14 +53,21 @@ yarn add react-native-video

Then follow the instructions for your platform to link react-native-video into your project:

### iOS installation
<details>
<summary>iOS</summary>
<summary>iOS details</summary>

#### Standard Method

**React Native 0.60 and above**

### Standard Method
Run `pod install` in the `ios` directory. Linking is not required in React Native 0.60 and above.

**React Native 0.59 and below**

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,9 +91,10 @@ end

</details>

<details>
<summary>tvOS</summary>

### tvOS installation
<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.

First select your project in Xcode.
Expand All @@ -95,14 +114,15 @@ Select RCTVideo-tvOS
<img src="./docs/tvOS-step-4.jpg" width="40%">
</details>

### Android installation
<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 @@ -118,19 +138,30 @@ include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
```

#### **android/app/build.gradle**

**android/app/build.gradle**
From version >= 5.0.0, you have to apply this changes:

```gradle
```diff
dependencies {
...
compile project(':react-native-video')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
+ implementation "androidx.appcompat:appcompat:1.0.0"
- implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"

}
```

**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 +182,13 @@ protected List<ReactPackage> getPackages() {
```
</details>

### Windows installation
<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 +197,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 +232,13 @@ using System.Collections.Generic;
```
</details>

### react-native-dom installation
<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 Expand Up @@ -259,8 +292,10 @@ var styles = StyleSheet.create({
### Configurable props
* [allowsExternalPlayback](#allowsexternalplayback)
* [audioOnly](#audioonly)
* [automaticallyWaitsToMinimizeStalling](#automaticallyWaitsToMinimizeStalling)
* [bufferConfig](#bufferconfig)
* [controls](#controls)
* [disableFocus](#disableFocus)
* [filter](#filter)
* [filterEnabled](#filterEnabled)
* [fullscreen](#fullscreen)
Expand Down Expand Up @@ -337,6 +372,13 @@ For this to work, the poster prop must be set.

Platforms: all

#### automaticallyWaitsToMinimizeStalling
A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling. For clients linked against iOS 10.0 and later
* **false** - Immediately starts playback
* **true (default)** - Delays playback in order to minimize stalling

Platforms: iOS

#### bufferConfig
Adjust the buffer settings. This prop takes an object with one or more of the properties listed below.

Expand Down Expand Up @@ -1126,7 +1168,7 @@ Save video to your Photos with current filter prop. Returns promise.

Example:
```
let response = await this.save();
let response = await this.player.save();
let path = response.uri;
```

Expand All @@ -1138,12 +1180,12 @@ Notes:
- Works with cached videos as well. (Checkout video-caching example)
- If the video is has not began buffering (e.g. there is no internet connection) then the save function will throw an error.
- If the video is buffering then the save function promise will return after the video has finished buffering and processing.

Future:
- Will support multiple qualities through options
- Will support more formats in the future through options
- Will support custom directory and file name through options

Platforms: iOS

#### restoreUserInterfaceForPictureInPictureStopCompleted
Expand Down Expand Up @@ -1270,6 +1312,38 @@ To enable audio to play in background on iOS the audio session needs to be set t

## Updating

### Version 5.0.0

Probably you want to update your gradle version:
#### gradle-wrapper.properties
```diff
- distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
```

#### **android/app/build.gradle**

From version >= 5.0.0, you have to apply this changes:

```diff
dependencies {
...
compile project(':react-native-video')
+ implementation "androidx.appcompat:appcompat:1.0.0"
- implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
}
```

#### **android/gradle.properties**

Migrating to AndroidX (needs version >= 5.0.0):

```gradle.properties
android.useAndroidX=true
android.enableJetifier=true
```

### Version 4.0.0

#### Gradle 3 and target SDK 26 requirement
Expand Down
1 change: 1 addition & 0 deletions Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ Video.propTypes = {
poster: PropTypes.string,
posterResizeMode: Image.propTypes.resizeMode,
repeat: PropTypes.bool,
automaticallyWaitsToMinimizeStalling: PropTypes.bool,
allowsExternalPlayback: PropTypes.bool,
selectedAudioTrack: PropTypes.shape({
type: PropTypes.string.isRequired,
Expand Down
Loading

0 comments on commit 01f37c5

Please sign in to comment.