Skip to content

Instantly share code, notes, and snippets.

@adelowo
Created February 13, 2020 02:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save adelowo/af4bfa2358c5cc05d35d6a2681774e79 to your computer and use it in GitHub Desktop.
import React, {Component} from 'react';
import {StyleSheet} from 'react-native';
import Video from 'react-native-video';
export default class VideoPlayer extends Component {
render() {
return (
<Video
source={{
uri:
'https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4',
}}
ref={ref => {
this.player = ref;
}}
style={styles.backgroundVideo}
controls={true}
/>
);
}
}
var styles = StyleSheet.create({
backgroundVideo: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment