Skip to content

Instantly share code, notes, and snippets.

@soska
Created April 25, 2015 04:21
Show Gist options
  • Save soska/e9de562d431e7369756f to your computer and use it in GitHub Desktop.
Save soska/e9de562d431e7369756f to your computer and use it in GitHub Desktop.
Youtube Iframe
var React = require('react-native');
var {
View,
WebView,
StyleSheet
} = React;
var style = StyleSheet.create({
container : {
height:300,
backgroundColor:'transparent'
},
frame : {
flex:1,
width:320,
height:315,
alignSelf:'stretch',
backgroundColor:'black'
}
});
var Iframe = React.createClass({
render() {
return (
<View style={style.container}>
<WebView
url={this.props.source}
automaticallyAdjustContentInsets={false}
style={style.frame}
/>
</View>
);
}
});
module.exports = Iframe;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment