mtellect / CameraDeepAR

MIT License
32 stars 50 forks source link

EventHandler #27

Open Bouchemel-Nasreddine opened 2 years ago

Bouchemel-Nasreddine commented 2 years ago

Hi, OnVideoRecordingComplete doesn't get invoked when stopVideoRecording is called

here is the handler inside the initState()

@override void initState() { super.initState(); CameraDeepArController.checkPermissions(); deepArController.setEventHandler(DeepArEventHandler( onCameraReady: (v) { _platformVersion = "onCameraReady $v"; setState(() {}); }, onSnapPhotoCompleted: (v) { _platformVersion = "onSnapPhotoCompleted $v"; setState(() {}); }, onVideoRecordingComplete: (v) { _platformVersion = "onVideoRecordingComplete $v"; setState(() {}); }, onSwitchEffect: (v) { _platformVersion = "onSwitchEffect $v"; setState(() {}); } ) ); }

and this is the Button that starts and stops recording

ElevatedButton( onPressed: () { !_isVideoRecording ? deepArController.startVideoRecording() : deepArController.stopVideoRecording(); _isVideoRecording = !_isVideoRecording;

        }, 
        child: const Text('start'),
      ),
mtellect commented 2 years ago

On what platform? Android or IOS

mtellect commented 2 years ago

if this is on IOS add this permission on the ios/runner/info.plist

` NSCameraUsageDescription

App needs access to allow you to capture your best moment
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>App needs access to allow you to capture your best moment</string>
<key>NSMicrophoneUsageDescription</key>
<string>App needs access to your mic to help your record voice notes on chat/message conversations</string>

`

Bouchemel-Nasreddine commented 2 years ago

no, this is on android

Bouchemel-Nasreddine commented 2 years ago

here is my manifest

`

...

`