Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cameraManager.stopVideoRecording doesn't triggering callback #266

Open
hiteshcmarix opened this issue Jul 19, 2022 · 2 comments
Open

cameraManager.stopVideoRecording doesn't triggering callback #266

hiteshcmarix opened this issue Jul 19, 2022 · 2 comments

Comments

@hiteshcmarix
Copy link

Sometimes, cameraManager.stopVideoRecording seems work perfection in lower duration recording, but when try to do more recording then it will not return completion block, it was not going in below condition because runningMovieOutput.isRecording returning false (in CameraManager.swift) and didn't get callback :

if let runningMovieOutput = movieOutput,
         runningMovieOutput.isRecording {
         videoCompletion = completion
        runningMovieOutput.stopRecording()
} 

I also tried different ways from given feedback like
1.) Moving cameraManager.cameraOutputMode in the "record" button method just before calling
cameraManager.startRecordingVideo()
but, this is not working.

2.) By checking and changing cameraOutputMode before start recording and after stop recording
Before start recording :
```
if cameraManager.cameraOutputMode == .stillImage {
print("Camera output is stillImage, switching to videoWithMic")
cameraManager.cameraOutputMode = .videoWithMic
}
cameraManager.startRecordingVideo()


      _After stop recording :_

        ```
cameraManager.stopVideoRecording { (URL, error) in
             print("Video Recording URL: ", URL!);
    
             if cameraManager.cameraOutputMode == .videoWithMic {
                     cameraManager.cameraOutputMode = .stillImage
             }
        }

I tried above solutions but none of these are working for me. 🙁
I am using CameraManager cocoapod (version 5.1.3)

Could you please help me out of this issue?
Waiting for your response...😌

@absolutvodka8888
Copy link

Please follow the instructions:

cameraManager.addLayerPreviewToView(cameraView, newCameraOutputMode: .videoOnly) {
self.cameraManager.startRecordingVideo()
}

@TomFluentjoy
Copy link

I have a question. I tried to stop recording, but it doesn't seem to have worked. Can you help me with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants