Skip to content

Commit

Permalink
Improve fullscreen documenation (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco authored and Matt Apperson committed Nov 3, 2016
1 parent cc7b7ab commit 605f4cf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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: {
Expand Down Expand Up @@ -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.*
Expand Down

0 comments on commit 605f4cf

Please sign in to comment.