You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
playInBackground={true|false} // Audio continues to play when app entering background. Default false
196
+
playWhenInactive={true|false} // [iOS] Video continues to play when control or notification center are shown. Default false
167
197
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.
168
198
progressUpdateInterval={250.0} // [iOS] Interval to fire onProgress (default to ~250ms)
199
+
onBuffer={this.onBuffer} // Callback when remote video is buffering
200
+
onEnd={this.onEnd} // Callback when playback finishes
201
+
onError={this.videoError} // Callback when video cannot be loaded
202
+
onFullscreenPlayerWillPresent={this.fullScreenPlayerWillPresent} // Callback before fullscreen starts
203
+
onFullscreenPlayerDidPresent={this.fullScreenPlayerDidPresent} // Callback after fullscreen started
204
+
onFullscreenPlayerWillDismiss={this.fullScreenPlayerWillDismiss} // Callback before fullscreen stops
205
+
onFullscreenPlayerDidDismiss={this.fullScreenPlayerDidDissmiss} // Callback after fullscreen stopped
169
206
onLoadStart={this.loadStart} // Callback when video starts to load
170
207
onLoad={this.setDuration} // Callback when video loads
171
208
onProgress={this.setTime} // Callback every ~250ms with currentTime
172
-
onEnd={this.onEnd} // Callback when playback finishes
173
-
onError={this.videoError} // Callback when video cannot be loaded
174
-
onBuffer={this.onBuffer} // Callback when remote video is buffering
175
209
onTimedMetadata={this.onTimedMetadata} // Callback when the stream receive some metadata
176
210
style={styles.backgroundVideo} />
177
211
178
212
// Later to trigger fullscreen
179
213
this.player.presentFullscreenPlayer()
180
214
215
+
// Disable fullscreen
216
+
this.player.dismissFullscreenPlayer()
217
+
181
218
// To set video position in seconds (seek)
182
219
this.player.seek(0)
183
220
@@ -192,70 +229,39 @@ var styles = StyleSheet.create({
192
229
},
193
230
});
194
231
```
232
+
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.
195
233
196
-
-**For iOS you also need to specify muted for this to work*
234
+
-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:
197
235
198
-
To see 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.
This will look for an .mp4 file (background.mp4) in the given expansion version.
231
250
232
251
### Load files with the RN Asset System
233
252
234
253
The asset system [introduced in RN `0.14`](http://www.reactnative.com/react-native-v0-14-0-released/) allows loading image resources shared across iOS and Android without touching native code. As of RN `0.31`[the same is true](https://github.com/facebook/react-native/commit/91ff6868a554c4930fd5fda6ba8044dbd56c8374) of mp4 video assets for Android. As of [RN `0.33`](https://github.com/facebook/react-native/releases/tag/v0.33.0) iOS is also supported. Requires `[email protected]`.
235
254
236
255
```
237
256
<Video
238
-
repeat
239
-
resizeMode='cover'
240
257
source={require('../assets/video/turntable.mp4')}
241
-
style={styles.backgroundVideo}
242
258
/>
243
259
```
244
260
245
261
### Play in background on iOS
246
262
247
263
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) )
248
264
249
-
## Static Methods
250
-
251
-
`seek(seconds)`
252
-
253
-
Seeks the video to the specified time (in seconds). Access using a ref to the component
254
-
255
-
`presentFullscreenPlayer()`
256
-
257
-
Toggles a fullscreen player. Access using a ref to the component.
258
-
259
265
## Examples
260
266
261
267
- 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.*
0 commit comments