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

问题描述 投票:0回答:1

我正在通过Expo构建相机应用(Android目标)。我的问题是在录制视频时。暂停后我期待着继续播放视频,应该继续录制,但是保存录制的视频后冻结了。

这是我的代码:

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方法中返回承诺)]

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
  • 设备:android
  • 我正在通过Expo构建相机应用(Android目标)。我的问题是在录制视频时。暂停后我期待着继续播放视频,应该继续录制,但是保存后就冻结了...

    android react-native camera record expo
    1个回答
    0
    投票

    pausePreview功能是否可以暂停录音?我不这么认为...只是暂停“预览”,而不是录制。请仔细检查参考中的pausePreview()resumePreview()功能。

    © www.soinside.com 2019 - 2024. All rights reserved.