Unverified Commit cacacd8b authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

Merge branch 'master' into master

parents 407ad14a dc0a48fc
Loading
Loading
Loading
Loading

.npmignore

deleted100644 → 0
+0 −1
Changes for .npmignore: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
/examples
+6 −1
Changes for CHANGELOG.md: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2,11 +2,16 @@

### Next Version
* Partial support for timed metadata on Android MediaPlayer [#707](https://github.com/react-native-community/react-native-video/pull/707)
* Update to ExoPlayer 2.8.2. Android SDK 26 now required [#1170](https://github.com/react-native-community/react-native-video/pull/1170)
* Support video caching for iOS [#955](https://github.com/react-native-community/react-native-video/pull/955)
* Video caching cleanups [#1172](https://github.com/react-native-community/react-native-video/pull/1172)
* Add ipod-library support [#926](https://github.com/react-native-community/react-native-video/pull/926/files)
* Fix crash on ExoPlayer when there are no audio tracks [#1233](https://github.com/react-native-community/react-native-video/pull/1233)
* Reduce package size [#1231](https://github.com/react-native-community/react-native-video/pull/1231)
* Remove unnecessary import in TextTrackType [#1229](https://github.com/react-native-community/react-native-video/pull/1229)
* Prevent flash between poster and video [#1167](https://github.com/react-native-community/react-native-video/pull/1167)
* Support react-native-dom [#1253](https://github.com/react-native-community/react-native-video/pull/1253)
* Update to ExoPlayer 2.8.2. Android SDK 26 now required [#1170](https://github.com/react-native-community/react-native-video/pull/1170)
* Update to ExoPlayer 2.8.4 [#1266](https://github.com/react-native-community/react-native-video/pull/1266)

### Version 3.2.0
* Basic fullscreen support for Android MediaPlayer [#1138](https://github.com/react-native-community/react-native-video/pull/1138)
+63 −3
Changes for README.md: 63 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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.
+0 −2
Changes for TextTrackType.js: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
import keyMirror from 'keymirror';

export default {
  SRT: 'application/x-subrip',
  TTML: 'application/ttml+xml',
+9 −23
Changes for Video.js: 9 added lines, 23 removed lines.
Original line number Diff line number Diff line
@@ -255,35 +255,21 @@ export default class Video extends Component {
      onExternalPlaybackChange: this._onExternalPlaybackChange,
    });

    if (this.props.poster && this.state.showPoster) {
    const posterStyle = {
        position: 'absolute',
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
        resizeMode: this.props.posterResizeMode || 'contain'
      ...StyleSheet.absoluteFillObject,
      resizeMode: this.props.posterResizeMode || 'contain',
    };

    return (
      <React.Fragment>
        <RCTVideo ref={this._assignRoot} {...nativeProps} />
        {this.props.poster &&
          this.state.showPoster && (
            <View style={nativeProps.style}>
          <RCTVideo
            ref={this._assignRoot}
            {...nativeProps}
          />
          <Image
            style={posterStyle}
            source={{uri: this.props.poster}}
          />
              <Image style={posterStyle} source={{ uri: this.props.poster }} />
            </View>
      );
    }

    return (
      <RCTVideo
        ref={this._assignRoot}
        {...nativeProps}
      />
          )}
      </React.Fragment>
    );
  }
}
Loading