Merge branch 'master' into master

This commit is contained in:
Hampton Maxwell
2018-10-07 16:07:11 -07:00
committed by GitHub
19 changed files with 562 additions and 40 deletions

View File

@@ -192,6 +192,31 @@ using System.Collections.Generic;
```
</details>
<details>
<summary>DOM</summary>
Make the following additions to the given files manually:
**dom/bootstrap.js**
Import RCTVideoManager and add it to the list of nativeModules:
```javascript
import { RNDomInstance } from "react-native-dom";
import { name as appName } from "../app.json";
import RCTVideoManager from 'react-native-video/dom/RCTVideoManager'; // Add this
// Path to RN Bundle Entrypoint ================================================
const rnBundlePath = "./entry.bundle?platform=dom&dev=true";
// React Native DOM Runtime Options =============================================
const ReactNativeDomOptions = {
enableHotReload: false,
nativeModules: [RCTVideoManager] // Add this
};
```
</details>
## Usage
```javascript
@@ -208,7 +233,6 @@ import Video from 'react-native-video';
this.player = ref
}} // Store reference
onBuffer={this.onBuffer} // Callback when remote video is buffering
onEnd={this.onEnd} // Callback when playback finishes
onError={this.videoError} // Callback when video cannot be loaded
style={styles.backgroundVideo} />
@@ -228,8 +252,10 @@ var styles = StyleSheet.create({
* [allowsExternalPlayback](#allowsexternalplayback)
* [audioOnly](#audioonly)
* [bufferConfig](#bufferconfig)
* [fullscreen (deprecated)](#fullscreen)
* [controls](#controls)
* [fullscreen](#fullscreen)
* [fullscreenOptions](#fullscreenOptions)
* [headers](#headers)
* [ignoreSilentSwitch](#ignoresilentswitch)
* [muted](#muted)
* [paused](#paused)
@@ -251,6 +277,8 @@ var styles = StyleSheet.create({
### Event props
* [onAudioBecomingNoisy](#onaudiobecomingnoisy)
* [onEnd](#onend)
* [onExternalPlaybackChange](#onexternalplaybackchange)
* [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent)
* [onFullscreenPlayerDidPresent](#onfullscreenplayerdidpresent)
* [onFullscreenPlayerWillDismiss](#onfullscreenplayerwilldismiss)
@@ -307,14 +335,21 @@ bufferConfig={{
Platforms: Android ExoPlayer
#### fullscreen (deprecated)
#### controls
Determines whether to show player controls.
* ** false (default)** - Don't show player controls
* **true** - Show player controls
Note on iOS, controls are always shown when in fullscreen mode.
Platforms: DOM, iOS
#### fullscreen
Controls whether the player enters fullscreen on play. Use fullscreenOptions for extended behaviour.
Platforms: iOS
#### fullscreenOptions
Controls behaviour of the player entering fullscreen, such as forcing landscape playback on portrait devices
Property | Type | Description
@@ -334,6 +369,21 @@ fullscreenOptions={{
Platforms: iOS
#### headers
Pass headers to the HTTP client. Can be used for authorization.
To enable this on iOS, you will need to manually edit RCTVideo.m and uncomment the header code in the playerItemForSource function. This is because the code used a private API and may cause your app to be rejected by the App Store. Use at your own risk.
Example:
```
headers = {{
Authorization: 'bearer some-token-value',
'X-Custom-Header': 'some value'
}}
```
Platforms: Android ExoPlayer
#### ignoreSilentSwitch
Controls the iOS silent switch behavior
* **"inherit" (default)** - Use the default AVPlayer behavior
@@ -615,6 +665,31 @@ Payload: none
Platforms: Android ExoPlayer, iOS
#### onEnd
Callback function that is called when the player reaches the end of the media.
Payload: none
Platforms: all
#### onExternalPlaybackChange
Callback function that is called when external playback mode for current playing video has changed. Mostly useful when connecting/disconnecting to Apple TV it's called on connection/disconnection.
Payload:
Property | Type | Description
--- | --- | ---
isExternalPlaybackActive | boolean | Boolean indicating whether external playback mode is active
Example:
```
{
isExternalPlaybackActive: true
}
```
Platforms: iOS
#### onFullscreenPlayerWillPresent
Callback function that is called when the player is about to enter fullscreen mode.
@@ -726,6 +801,8 @@ Example:
}
```
Platforms: all
#### onTimedMetadata
Callback function that is called when timed metadata becomes available
@@ -771,7 +848,7 @@ this.player.dismissFullscreenPlayer();
Platforms: Android ExoPlayer, Android MediaPlayer, iOS
#### FullscreenPlayer
#### presentFullscreenPlayer
`presentFullscreenPlayer()`
Put the player in fullscreen mode.