showing results for - "camera with expo"
Andrea
19 Nov 2016
1import React, { useState, useEffect } from 'react';
2import { Text, View, TouchableOpacity } from 'react-native';
3import { Camera } from 'expo-camera';
4
5export default function App() {
6  const [hasPermission, setHasPermission] = useState(null);
7  const [type, setType] = useState(Camera.Constants.Type.back);
8
9  useEffect(() => {
10    (async () => {
11      const { status } = await Camera.requestPermissionsAsync();
12      setHasPermission(status === 'granted');
13    })();
14  }, []);
15
16  if (hasPermission === null) {
17    return <View />;
18  }
19  if (hasPermission === false) {
20    return <Text>No access to camera</Text>;
21  }
22  return (
23    <View style={{ flex: 1 }}>
24      <Camera style={{ flex: 1 }} type={type}>
25        <View
26          style={{
27            flex: 1,
28            backgroundColor: 'transparent',
29            flexDirection: 'row',
30          }}>
31          <TouchableOpacity
32            style={{
33              flex: 0.1,
34              alignSelf: 'flex-end',
35              alignItems: 'center',
36            }}
37            onPress={() => {
38              setType(
39                type === Camera.Constants.Type.back
40                  ? Camera.Constants.Type.front
41                  : Camera.Constants.Type.back
42              );
43            }}>
44            <Text style={{ fontSize: 18, marginBottom: 10, color: 'white' }}> Flip </Text>
45          </TouchableOpacity>
46        </View>
47      </Camera>
48    </View>
49  );
50}
51
queries leading to this page
share camera view from expo to internetreact native camera expo exampleexpo camera apiexpo camera full guidecamera2 in expoexpo camera is person or picturerecord async camera expocamera with expouse react native camera in expoexpo camera doctakepictureasync expocamera 2 api expolinking react native camera expoexpo camera take picture exampleexpo camera methodscreate expo camera referencecamera remain active after component unmount expo webexpo access to cameracan i use camera with expoexpo camera closeexpo camera reactexpo camera class based componentreact native camera using expoexpo camera open videoexpo camera is not taking quality picturesexpo luch cameraexpo camera npmexpo camera previewexpo facedetector image captureimport 7b camera 7d from 27expo 27 3bexpo camera recordasync 28 29 example record video from camera mobileis expo camera a apireact native expor cameracamera image exposave video file expo cameraexpo cameraref takepictureasync 28 29expo access camera androidhow to take picture with expo cameraexpo access to camera viewexpo camera flashexpo browser camerainstall expo cameraexpo use cameraexpo camera screenaccess camera react native expoexpo app use camerareactr native camera expoexpo stream from cameraexpo take imageopen camera expoexpo camera exampleexpo camera takepictureasync examplereact native expo cameraexpo camera androidexpo camera react nativerun camera inside a viiew expo cameraexpo camera component examplehow to auto capture in expotake picture expo cameraexpo camera alternative for bare react nativeusing expo cameraexpo camera example in expoexpo camera videosexpo camera capture exampleexpo open cameracamera requestpermissionsasynchow to make camera acess expoexpo camera demoreact native expo camera examplereact native expo access cameraproject 3aexpo cameraimport expo camera 3ccamerapreview 3e expo react nativetake photo in react native app expotake photo camera expoexpo camera styling in android and iosreact native expo camera take pictureopen device camera expo react nativeexpo camera functional componentexpo camera webexpo install cameraaccess camera in react native exporeact native camera with expouse camera in expo app androidexpo camera optionsexpo camera qualityaccessing camera react native expoexpo camera examplecamera in react native expocamera expoexpo camera reference docexpo take pictureexpo camera in react native expo camera propsexpo camera react native cliexpo camera take picturetake a picture expo webexpo linking device cameratake photo expo functionaluse camera in react native expoexpo camera now showing in appexpo camera appcamera expo react native start and stophow to turn off expo cameraexpo image capture cameraexpo camera issues list in androidimport camera from exporeactnative camera expoexpo camera vs react native camerahow to open camera in react native exporn expo camera android front formatexpo camera stylingexpo camera in react nativeexpo camera aspect ratioputting text on expo cameraexpo remove camerahow to use camera in expo react natieios camera expodisable expo camera react nativeexpo video recordingexpo camera take photoselfie camera react native expoexpo camera declare cameraexpo video recorderexpo react native cameraexpo cameraexpo how to use the camera 22expo install expo camera 22camera react native expoexpo camera libraryexpo camera motionaccessing camera in expo react nativereact native cameraexpo camera setupreact native expo camera nativecamera requestpermissionsasync webexpo react native take pictureexpo camera 3fexpo record videouse camera expocamera takepictureasyncreact native expo take picturereact native camera expo class componentcamera settings not showing expoexpo camera moduleexpo react native take picture exampleexpo take photoexpo camera a apiexpo camera only center screencamera didn e2 80 99t load 28is that intentional for test version 3f 29 in react native expocamera requestpermissionsasync 28 29 audiolet camera 3a camera expoexpo camera on iosexpo how to access camerafirst video returns null expo camerareact native link react native camera with expouse expo cameraexpo camera class exampleexpo camera takepictureasynccamera expo react nativecamera reference react native expo recordasyncreact native camera exporeact native camera expoexpo camera module 2aexpo camera in exporeact native camera expo not working on android file pathexpo cameraldoes expo support cameratake image form camera expoopen camera in expoexpo camera record video with maximum time limitadding flash light to camera expo react nativeexpo camera settingsreact native expo class component cameraexpo camera real personexpo camera referenceexpo allow device cameraexpo camera now preview showing in appopen camera with expoexpo camera type front adroidcamera api expohow to use expo cameracamera app linking expocamera with expo