@@ -200,7 +200,7 @@ protected virtual partial void PlatformDisconnect()
200200
201201 protected virtual async partial Task PlatformStartVideoRecording ( Stream stream , CancellationToken token )
202202 {
203- var isPermissionGranted = await AVCaptureDevice . RequestAccessForMediaTypeAsync ( AVAuthorizationMediaType . Video ) ;
203+ var isPermissionGranted = await AVCaptureDevice . RequestAccessForMediaTypeAsync ( AVAuthorizationMediaType . Video ) . WaitAsync ( token ) ;
204204 if ( ! isPermissionGranted )
205205 {
206206 throw new CameraException ( "Camera permission is not granted. Please enable it in the app settings." ) ;
@@ -235,7 +235,7 @@ protected virtual async partial Task PlatformStartVideoRecording(Stream stream,
235235 var audioDevice = AVCaptureDevice . GetDefaultDevice ( AVMediaTypes . Audio ) ;
236236 if ( audioDevice is not null )
237237 {
238- audioInput = new AVCaptureDeviceInput ( audioDevice , out var audioError ) ;
238+ audioInput = new AVCaptureDeviceInput ( audioDevice , out NSError ? audioError ) ;
239239 if ( audioError is null && captureSession . CanAddInput ( audioInput ) )
240240 {
241241 captureSession . AddInput ( audioInput ) ;
@@ -283,7 +283,12 @@ protected virtual async partial Task PlatformStartVideoRecording(Stream stream,
283283
284284 protected virtual async partial Task < Stream > PlatformStopVideoRecording ( CancellationToken token )
285285 {
286- if ( captureSession is null || videoRecordingFileName is null || videoInput is null || videoOutput is null || videoRecordingStream is null || videoRecordingFinalizeTcs is null )
286+ if ( captureSession is null
287+ || videoRecordingFileName is null
288+ || videoInput is null
289+ || videoOutput is null
290+ || videoRecordingStream is null
291+ || videoRecordingFinalizeTcs is null )
287292 {
288293 return Stream . Null ;
289294 }
0 commit comments