Improve fullscreen documenation (#364)
This commit is contained in:
parent
cc7b7abdca
commit
605f4cf070
13
README.md
13
README.md
@ -88,6 +88,9 @@ Under `.addPackage(new MainReactPackage())`:
|
||||
// on a single screen if you like.
|
||||
|
||||
<Video source={{uri: "background"}} // Can be a URL or a local file.
|
||||
ref={(ref) => {
|
||||
this.player = ref
|
||||
}} // Store reference
|
||||
rate={1.0} // 0 is paused, 1 is normal.
|
||||
volume={1.0} // 0 is muted, 1 is normal.
|
||||
muted={false} // Mutes the audio entirely.
|
||||
@ -104,6 +107,12 @@ Under `.addPackage(new MainReactPackage())`:
|
||||
onError={this.videoError} // Callback when video cannot be loaded
|
||||
style={styles.backgroundVideo} />
|
||||
|
||||
// Later to trigger fullscreen
|
||||
this.player.presentFullscreenPlayer()
|
||||
|
||||
// To set video position in seconds (seek)
|
||||
this.player.seek(0)
|
||||
|
||||
// Later on in your styles..
|
||||
var styles = StyleSheet.create({
|
||||
backgroundVideo: {
|
||||
@ -171,6 +180,10 @@ To enable audio to play in background on iOS the audio session needs to be set t
|
||||
|
||||
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.*
|
||||
|
Loading…
Reference in New Issue
Block a user