playInBackground={true|false}// Audio continues to play when app entering background. Default false
playWhenInactive={true|false}// [iOS] Video continues to play when control or notification center are shown. Default false
ignoreSilentSwitch={"ignore"}// [iOS] ignore | obey - When 'ignore', audio will still play with the iOS hard silent switch set to silent. When 'obey', audio will toggle with the switch. When not specified, will inherit audio settings as usual.
progressUpdateInterval={250.0}// [iOS] Interval to fire onProgress (default to ~250ms)
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
onFullscreenPlayerWillPresent={this.fullScreenPlayerWillPresent}// Callback before fullscreen starts
onFullscreenPlayerDidPresent={this.fullScreenPlayerDidPresent}// Callback after fullscreen started
onFullscreenPlayerWillDismiss={this.fullScreenPlayerWillDismiss}// Callback before fullscreen stops
onFullscreenPlayerDidDismiss={this.fullScreenPlayerDidDissmiss}// Callback after fullscreen stopped
onLoadStart={this.loadStart}// Callback when video starts to load
onLoad={this.setDuration}// Callback when video loads
onProgress={this.setTime}// Callback every ~250ms with currentTime
onEnd={this.onEnd}// Callback when playback finishes
onError={this.videoError}// Callback when video cannot be loaded
onBuffer={this.onBuffer}// Callback when remote video is buffering
onTimedMetadata={this.onTimedMetadata}// Callback when the stream receive some metadata
style={styles.backgroundVideo}/>
// Later to trigger fullscreen
this.player.presentFullscreenPlayer()
// Disable fullscreen
this.player.dismissFullscreenPlayer()
// To set video position in seconds (seek)
this.player.seek(0)
@@ -191,39 +228,24 @@ var styles = StyleSheet.create({
},
});
```
To see the full list of available props, you can check the [propTypes](https://github.com/react-native-community/react-native-video/blob/master/Video.js#L246) of the Video.js component.
-* *For iOS you also need to specify muted for this to work*
-By default, iOS 9+ will only load encrypted HTTPS urls. If you need to load content from a webserver that only supports HTTP, you will need to modify your Info.plist file and add the following entry:
This will look for an .mp4 file (background.mp4) in the given expansion version.
### Load files with the RN Asset System
@@ -231,10 +253,7 @@ The asset system [introduced in RN `0.14`](http://www.reactnative.com/react-nati
```
<Video
repeat
resizeMode='cover'
source={require('../assets/video/turntable.mp4')}
style={styles.backgroundVideo}
/>
```
@@ -242,16 +261,6 @@ The asset system [introduced in RN `0.14`](http://www.reactnative.com/react-nati
To enable audio to play in background on iOS the audio session needs to be set to `AVAudioSessionCategoryPlayback`. See [Apple documentation][3] for additional details. (NOTE: there is now a ticket to [expose this as a prop](https://github.com/react-native-community/react-native-video/issues/310) )
## Static Methods
`seek(seconds)`
Seeks the video to the specified time (in seconds). Access using a ref to the component
`presentFullscreenPlayer()`
Toggles a fullscreen player. Access using a ref to the component.
## Examples
- See an [Example integration][1] in `react-native-login`*note that this example uses an older version of this library, before we used `export default` -- if you use `require` you will need to do `require('react-native-video').default` as per instructions above.*