Last active
December 23, 2017 13:41
-
-
Save eyalcohen4/fd2121cb7f9f3f8a991ea09369f4b5d8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// At the top of our file | |
import { MaterialIcons, Octicons } from '@expo/vector-icons'; | |
// In our App class | |
render() { | |
const { width } = Dimensions.get('window'); | |
return ( | |
<View style={styles.container}> | |
<View> | |
<Text style={{ textAlign: 'center' }}> React Native Video </Text> | |
<Video | |
source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }} | |
shouldPlay={this.state.shouldPlay} | |
resizeMode="cover" | |
style={{ width, height: 300 }} | |
isMuted={this.state.mute} | |
/> | |
<View style={styles.controlBar}> | |
<MaterialIcons | |
name={this.state.mute ? "volume-mute" : "volume-up"} | |
size={45} | |
color="white" | |
onPress={this.handleVolume} | |
/> | |
<MaterialIcons | |
name={this.state.shouldPlay ? "pause" : "play-arrow"} | |
size={45} | |
color="white" | |
onPress={this.handlePlayAndPause} | |
/> | |
</View> | |
</View> | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment