react-native-videoplayer
v1.2.0
Published
A native ios video player component
Downloads
7
Maintainers
Readme
react-native-videoplayer
A native ios video player component
Add it to your project
- Run
npm install react-native-videoplayer --save
- Open your project in XCode, right click on your project and click
Add Files to "Your Project Name"
- Add
RCTVideoPlayer
from yournode_modules/react-native-videoplayer
folder. - Whenever you want to use it within React Native code now you can:
var VideoPlayer = require('react-native-videoplayer');
Usage
<View style={styles.container}>
<VideoPlayer style={styles.video} url="http://somevideourl.mp4"/>
</View>
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
video: {
position: 'absolute',
top: 0, left: 0, right: 0, bottom: 0,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'transparent'
}
});
Attributes
url
Must be a url to a video resource.