Skip to content

Instantly share code, notes, and snippets.

@eyalcohen4
Last active December 23, 2017 13:41
Show Gist options
  • Save eyalcohen4/fd2121cb7f9f3f8a991ea09369f4b5d8 to your computer and use it in GitHub Desktop.
Save eyalcohen4/fd2121cb7f9f3f8a991ea09369f4b5d8 to your computer and use it in GitHub Desktop.
// 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