I am using camera API to recorder video.
After pressing ‘recorder’ button, it calls const video = await this.camera.recordAsync(options);
and then press ‘stop’ button, is calls this.camera.stopRecording();
the video is successfully created.
But after ‘stopRecording()’ is called, the screen is dark, then I press ‘recorder’ button again, the app return exception saying ’ Camera is not running’
According to the document, recordAsync() returns when the user stops recording or recording time is up. So code after ‘recordAsync()’ all happen after recording is stopped. So I don’t think setting isRecording be falsy is wrong.
You’re correct, that was my misunderstanding. Sorry about that.
I’m working on an example snack that should give you a good example to follow to get the recordAsync() function to run properly, after already having called it once.
Here is a snack example using recordAsync(), recording a new video after already having recorded one before works here. From here it should be easy to spot differences in your code, and why you’re getting the ‘Camera is not running’ error message.
When I click the ‘START RECORDING’ button, I saw black screen, and nothing happens. My phone is in a different network with expo.io. Not sure if this is the reason.
I am using Andorid version 9. Device is Android one MI A1.
@wang, I am looking into this now. Works on my iPhone, but since camera cannot be accessed through the simulator, it’s hard for me to test why Android isn’t functioning properly.