Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
906 stars 199 forks source link

Video has no sound after recording #462

Open nguyenxuankiet262 opened 2 months ago

nguyenxuankiet262 commented 2 months ago

Steps to Reproduce

Expected results

The video must have sound

g-apparence commented 2 months ago

You have to add the right to have sound either the video result won't have sound.

nguyenxuankiet262 commented 2 months ago

You have to add the right to have sound either the video result won't have sound.

Hi! I just run the basic example and I allowed microphone permission.

When i switch to video camera and record in the first time, the video will have sound. Then i switch to photo camera and switch to video camera again, the next recorded video will have no sound.

You can try my steps

It's an urgent bug

Btw, your lib is very awesome

nguyenxuankiet262 commented 1 month ago

If anyone get this issue, update below codes and it'll work

- (void)setCaptureMode:(CaptureModes)captureMode error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error {
    NSLog(@"setCaptureMode");
  if (_videoController.isRecording) {
    *error = [FlutterError errorWithCode:@"CAPTURE_MODE" message:@"impossible to change capture mode, video already recording" details:@""];
    return;
  }

  _captureMode = captureMode;

  if (captureMode == Video) {
    // [self setUpCaptureSessionForAudioError:^(NSError *audioError) {
    //   *error = [FlutterError errorWithCode:@"VIDEO_ERROR" message:@"error when trying to setup audio" details:[audioError localizedDescription]];
    // }];
  }
}