Skip to content

Instantly share code, notes, and snippets.

View eyalcohen4's full-sized avatar

Eyal Cohen eyalcohen4

View GitHub Profile
// 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>
export default class App extends React.Component {
state = {
mute: false,
fullScreen: false,
shouldPlay: true,
}
handlePlayAndPause = () => {
this.setState((prevState) => ({
shouldPlay: !prevState.shouldPlay
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
controlBar: {
position: 'absolute',
bottom: 0,
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
import { MaterialIcons, Octicons } from '@expo/vector-icons';
export default class App extends React.Component {
state = {
mute: false,
fullScreen: false,
shouldPlay: false,
}
render() {
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
@eyalcohen4
eyalcohen4 / react-native-video-step-2.js
Last active December 16, 2017 12:20
Add dimensions
import React from 'react';
import { StyleSheet, Text, View, Dimensions } from 'react-native';
import { Video } from 'expo';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Video } from 'react-native';
$ npm install -g create-react-native-app
@eyalcohen4
eyalcohen4 / React native aliases
Created December 6, 2017 11:45
Terminal aliases for react-native cli
# 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"