From b58c7e0f978e6f8804542115d0ce591ea9301ce2 Mon Sep 17 00:00:00 2001 From: Tobias Hasselrot Date: Thu, 2 Jun 2016 08:29:16 +0200 Subject: [PATCH] Added documentation of playInBackground and playWhenInactive props. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 48cfbb3e..9fe041e5 100644 --- a/README.md +++ b/README.md @@ -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 ---