title: Camera is not running
body: <p>I’m trying to make a prototype application that over and over</p>
  
  <p>1- record a video with the camera for x seconds</p>
  
  <p>2- displays this video</p>
  
  <p>For this I use the components Camera from expo-camera and Video from expo-av</p>
  
  <p>For this I have two views :</p>
  
  <p>I use in my code the stateSequence property and the sequencer() function which displays alternately the view with the Camera component which films for x seconds , and the video view which allows me to display the video.</p>
  
  <p>Sequencer() is triggered with setInterval( this.sequencer , 10000) found in the componentWillMount()</p>
  
  <p>I can switch alternately from a View with the Camera component to a View with the Video component.</p>
  
  <p>To record a video with the Camera component I use recordAsync(), but I get the following error:</p>
  
  <pre><code>Unhandled promise rejection: Error: Camera is not running
  </code></pre>
  
  <p>I’m using an android phone for my tests.</p>
  
  <p>Can’t you help me</p>
  
  <p>this is my code</p>
  
  <pre><code>import { StyleSheet, Text, View ,TouchableOpacity} from 'react-native';
  
  import * as Permissions from 'expo-permissions';
  import { Camera } from 'expo-camera';
  import { Video } from 'expo-av';
  import { Logs } from 'expo';
  
  
  export default class SequenceViewer extends Component {
    constructor(props) {
      super(props);
      this.state = {
        stateSequence: "SHOOT ",
        hasCameraPermission: null,
        type: Camera.Constants.Type.front,
      }
      this.recordVideo = this.recordVideo.bind(this)
    }
  
    sequencer = () =&gt; {  
  
      if(this.state.stateSequence==="WATCH"){ 
        this.setState({  stateSequence: "SHOOT",})
  
        this.recordVideo();  //  Error message   Camera is not running
  
      } else {
        this.setState({stateSequence: "WATCH"})
      }
  
  
    }
  
    async componentWillMount() {    
      let  rollStatus  = await Permissions.askAsync(Permissions.CAMERA_ROLL);
      let cameraResponse = await Permissions.askAsync(Permissions.CAMERA)
      if (rollStatus.status=='granted'){
        if (cameraResponse.status == 'granted' ){
          let audioResponse = await Permissions.askAsync(Permissions.AUDIO_RECORDING);
          if (audioResponse.status == 'granted'){
            this.setState({ permissionsGranted: true });
  
            setInterval( this.sequencer , 10000);
  
          }  
        }
      }                  
    }
  
    recordVideo = async () =&gt; {
  
              if(this.state.cameraIsRecording){
                this.setState({cameraIsRecording:false})
                this.camera.stopRecording();
              }
              else {
                this.setState({cameraIsRecording:true})
                if (this.camera) {
                  let record = await  this.camera.recordAsync(quality='480p',maxDuration=5,mute=true).then( data =&gt;{
  
                    this.setState( {recVideoUri :data.uri})                         
                  }) 
               }   
  
              }
    };  
  
  
    render() {
  
      const { hasCameraPermission } = this.state
        if(this.state.stateSequence=="WATCH")
        {
          return(
            &lt;View style={styles.container}&gt;
             &lt;Video
                source={{ uri:this.state.recVideoUri }}
                rate={1.0}
                volume={1.0}
                isMuted={false}
                resizeMode="cover"
                shouldPlay
                isLooping
                style={{ width: 300, height: 300 }}
                ref={(ref) =&gt; { this.player = ref }}   
              /&gt;
          &lt;/View&gt;  
          )
  
        } else
        {
          return(
  
            &lt;View style={{ flex: 1 }}&gt;
            &lt;Camera style={{ flex: 1 }} type={this.state.type}  ref={ref =&gt; {this.camera = ref; }}&gt;&lt;/Camera&gt;
          &lt;/View&gt;
  
          )
        }
    }
  }
  
  const styles = StyleSheet.create({
      viewerText: {
          fontSize: 20,
          fontWeight: 'bold',
      },
      container: {
        flex: 1,
        backgroundColor: '#fff',
        alignItems: 'center',
        justifyContent: 'center',
      },
    });
  </code></pre>
  
  <p>Thank you</p>