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
920 stars 208 forks source link

Video .pauseRecording() is not working #237

Open Origogi opened 1 year ago

Origogi commented 1 year ago

Steps to Reproduce

When Video Capturing

  1. (cameraState as VideoCameraState).startRecording();
  2. User action for pausing capture
  3. (cameraState as VideoRecordingCameraState).pauseRecording(currentCapture!);

below my code

final CameraState cameraState;

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    ref.listen(videoRecordStateProvider, (prev, next) async {
      if (next == VideoRecordState.pause) {

        final currentCapture = await cameraState.captureState$.single;
        await (cameraState as VideoRecordingCameraState)
            .pauseRecording(currentCapture!);
      } else if (next == VideoRecordState.resume) {
        if (prev == VideoRecordState.idle) {
          (cameraState as VideoCameraState).startRecording();
        } else {
          logger.d('test');
          final currentCapture = await cameraState.captureState$.last;
          (cameraState as VideoRecordingCameraState)
              .resumeRecording(currentCapture!);
        }
      } else if (next == VideoRecordState.complete) {
        if (cameraState is VideoRecordingCameraState) {
          (cameraState as VideoRecordingCameraState).stopRecording();
        }
      }
    });
}

Expected results

pause video recording

Actual results

Don't pause video record and still recording video

About your device

Android, iOS all

g-apparence commented 1 year ago

Hi, There is some missing informations.

THank you