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> |
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
export default class App extends React.Component { | |
state = { | |
mute: false, | |
fullScreen: false, | |
shouldPlay: true, | |
} | |
handlePlayAndPause = () => { | |
this.setState((prevState) => ({ | |
shouldPlay: !prevState.shouldPlay |
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
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#fff', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
controlBar: { | |
position: 'absolute', | |
bottom: 0, |
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
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 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
import { MaterialIcons, Octicons } from '@expo/vector-icons'; | |
export default class App extends React.Component { | |
state = { | |
mute: false, | |
fullScreen: false, | |
shouldPlay: false, | |
} | |
render() { |
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
export default class App extends React.Component { | |
render() { | |
const { width } = Dimensions.get('window'); | |
return ( | |
<View style={styles.container}> | |
<Text style={{ textAlign: 'center' }}> React Native Video </Text> | |
<Video | |
source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }} | |
shouldPlay |
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
import React from 'react'; | |
import { StyleSheet, Text, View, Dimensions } from 'react-native'; | |
import { Video } from 'expo'; |
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
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { Video } from 'react-native'; |
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
$ npm install -g create-react-native-app |
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
# Paste it in your .zshrc / .bashrc | |
alias rnand="react-native run-android" | |
alias rnios="react-native run-ios" | |
alias rnloga="react-native log-android" | |
alias rnlogi="react-native log-ios" | |
alias rns="react-native start" |