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

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.

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)