This commit is contained in:
tobias 2016-06-02 08:30:05 +02:00
commit a10fe7501f

View File

@ -71,6 +71,8 @@ Under `.addPackage(new MainReactPackage())`:
paused={false} // Pauses playback entirely.
resizeMode="cover" // Fill the whole screen at aspect ratio.
repeat={true} // Repeat forever.
playInBackground={false} // Audio continues to play when app entering background.
playWhenInactive={false} // [iOS] Video continues to play when control or notification center are shown.
onLoadStart={this.loadStart} // Callback when video starts to load
onLoad={this.setDuration} // Callback when video loads
onProgress={this.setTime} // Callback every ~250ms with currentTime
@ -90,6 +92,10 @@ var styles = StyleSheet.create({
});
```
### Play in background on iOS
To enable audio to play in background on iOS the audio session needs to be set to `AVAudioSessionCategoryPlayback`. See [Apple documentation][3].
## Static Methods
`seek(seconds)`
@ -120,6 +126,7 @@ Seeks the video to the specified time (in seconds). Access using a ref to the co
[1]: https://github.com/brentvatne/react-native-login/blob/56c47a5d1e23781e86e19b27e10427fd6391f666/App/Screens/UserInfoScreen.js#L32-L35
[2]: https://github.com/brentvatne/react-native-video/tree/master/Examples/VideoPlayer
[3]: https://developer.apple.com/library/ios/qa/qa1668/_index.html
---