Pause and Resume recording a video is not continue

I am building a camera app (android target) with expo. My problem is during recording a video. I look forward after pause and resume a video It should record continue but it’s freezed after I save my record video.

This is my code:

if (!this.state.isStartRecordVideo) {
        this.props.pauseRecordVideo();
}
else {
        this.props.resumeRecordVideo();
}

startRecordVideo method to start a record video:

async startRecordVideo() {
    let video = await this.camera.recordAsync({ quality: '1080' });
    await CameraRoll.saveToCameraRoll(video.uri, 'video');
}

stopRecordVideo method to stop and save a record video (return a promise in startRecordVideo method)

async stopRecordVideo() {
    await this.camera.stopRecording();
}

FooterCamera is a component which contain pausePreview and resumePreview

<FooterCamera
    ref={(footer) => this.footer_camera = footer}
    imageUri={this.state.imageUri}
    takePicture={(timer, quality) => this.takePicture(timer, quality)}
    startRecordVideo={() => this.startRecordVideo()}
    stopRecordVideo={() => this.stopRecordVideo()}
    pauseRecordVideo={() => this.camera.pausePreview()}
    resumeRecordVideo={() => this.camera.resumePreview()}
    stopCountDownAnimate={() => this.stopCountDownAnimate()}
/>
  1. expo version: 2.1.3
  2. Device: android

Hey @john_snow,

Just for clarification, are you expecting there to be two video files when all is said and done or one file that is a combination of the recorded video before and after the pausing? If it’s the latter, that isn’t currently supported.

Cheers,

Adam

Right, you can see a repo case above. I wish It just record in a one file after pause and resume. If it isn’t current supported then I should eject or not?

If you want to be able to stop and resume a single recorded video then yes, you’ll have to eject. You can also upvote this feature request: Allow resuming recording on camera | Voters | Expo so we know you want said feature as well!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.