1// Load the module
2
3import Video from 'react-native-video';
4
5// Within your render function, assuming you have a file called
6// "background.mp4" in your project. You can include multiple videos
7// on a single screen if you like.
8
9<Video source={{uri: "background"}} // Can be a URL or a local file.
10 ref={(ref) => {
11 this.player = ref
12 }} // Store reference
13 onBuffer={this.onBuffer} // Callback when remote video is buffering
14 onError={this.videoError} // Callback when video cannot be loaded
15 style={styles.backgroundVideo} />
16
17// Later on in your styles..
18var styles = StyleSheet.create({
19 backgroundVideo: {
20 position: 'absolute',
21 top: 0,
22 left: 0,
23 bottom: 0,
24 right: 0,
25 },
26});