Merge branch 'master' into master

This commit is contained in:
Hampton Maxwell
2018-10-07 15:58:32 -07:00
committed by GitHub
14 changed files with 506 additions and 38 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,6 +252,8 @@ var styles = StyleSheet.create({
* [allowsExternalPlayback](#allowsexternalplayback)
* [audioOnly](#audioonly)
* [bufferConfig](#bufferconfig)
* [controls](#controls)
* [headers](#headers)
* [ignoreSilentSwitch](#ignoresilentswitch)
* [muted](#muted)
* [paused](#paused)
@@ -249,6 +275,7 @@ var styles = StyleSheet.create({
### Event props
* [onAudioBecomingNoisy](#onaudiobecomingnoisy)
* [onEnd](#onend)
* [onExternalPlaybackChange](#onexternalplaybackchange)
* [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent)
* [onFullscreenPlayerDidPresent](#onfullscreenplayerdidpresent)
@@ -306,6 +333,30 @@ bufferConfig={{
Platforms: Android ExoPlayer
#### 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
#### 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
@@ -587,6 +638,13 @@ 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.
@@ -594,7 +652,7 @@ Payload:
Property | Type | Description
--- | --- | ---
isExternalPlaybackActive | boolean | Boolean indicating is external playback mode is active
isExternalPlaybackActive | boolean | Boolean indicating whether external playback mode is active
Example:
```
@@ -716,6 +774,8 @@ Example:
}
```
Platforms: all
#### onTimedMetadata
Callback function that is called when timed metadata becomes available
@@ -761,7 +821,7 @@ this.player.dismissFullscreenPlayer();
Platforms: Android ExoPlayer, Android MediaPlayer, iOS
#### FullscreenPlayer
#### presentFullscreenPlayer
`presentFullscreenPlayer()`
Put the player in fullscreen mode.