Created
August 16, 2018 19:34
-
-
Save adhithiravi/e17d409c6cc412f2fa31b313215edb04 to your computer and use it in GitHub Desktop.
VideoComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import PropTypes from 'prop-types' | |
import { View, StyleSheet } from 'react-native' | |
import Video from 'react-native-video' | |
export default class VideoComponent extends React.Component { | |
renderVideo () { | |
return( | |
<Video | |
source={require('./assets/Piano_Playing_Close.mp4')} | |
style={{ width: 800, height: 800 }} | |
muted={true} | |
repeat={true} | |
resizeMode={"cover"} | |
volume={1.0} | |
rate={1.0} | |
ignoreSilentSwitch={"obey"} | |
/> | |
) | |
} | |
render () { | |
return ( | |
<View> | |
{this.renderVideo()} | |
</View> | |
) | |
} | |
} | |
// Later on in your styles.. | |
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