暂停和继续录制视频不继续

Pause and Resume recording a video is not continue(暂停和继续录制视频不继续)

本文介绍了暂停和继续录制视频不继续的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个带有 expo 的相机应用程序(android 目标).我的问题是在录制视频时.我在暂停和恢复视频后期待它应该继续录制,但在我保存我的录制视频后它被冻结了.

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.

这是我的代码:

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

startRecordVideo方法开始录制视频:

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

stopRecordVideo 方法停止并保存录制视频(在 startRecordVideo 方法中返回一个承诺)

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

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

FooterCamera 是一个包含 pausePreviewresumePreview

<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. 世博版本:2.1.3
  2. 设备:安卓

推荐答案

pausePreview 功能可以暂停录制吗?我不这么认为......它只是暂停预览",而不是录制.请仔细检查参考中的 pausePreview()resumePreview() 函数.

pausePreview function works to pause recording? I don't think so... It just pauses "preview", not recording. Please double check about pausePreview() and resumePreview() function in reference.

这篇关于暂停和继续录制视频不继续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:暂停和继续录制视频不继续

基础教程推荐