This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/cordova-plugin-media-capture.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e9b73a  fix(ios): CAPTURE_APPLICATION_BUSY error when dismissing 
modal by swipe (#278)
9e9b73a is described below

commit 9e9b73a2646adc6ff453577229b2cfe5edb104dd
Author: エリス <[email protected]>
AuthorDate: Wed Aug 9 16:17:11 2023 +0900

    fix(ios): CAPTURE_APPLICATION_BUSY error when dismissing modal by swipe 
(#278)
    
    Co-authored-by: Denis Kovalev <[email protected]>
---
 src/ios/CDVCapture.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index 500f075..aa9a0d9 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -613,7 +613,7 @@
 
 @end
 
-@interface CDVAudioRecorderViewController () {
+@interface CDVAudioRecorderViewController () 
<UIAdaptivePresentationControllerDelegate> {
     UIStatusBarStyle _previousStatusBarStyle;
 }
 @end
@@ -737,6 +737,9 @@
     UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, 
nil);
     NSError* error = nil;
 
+    // Add delegate to catch the dismiss event
+    self.navigationController.presentationController.delegate = self;
+
     if (self.avSession == nil) {
         // create audio session
         self.avSession = [AVAudioSession sharedInstance];
@@ -946,4 +949,8 @@
     [self dismissAudioView:nil];
 }
 
+- (void)presentationControllerDidDismiss:(UIPresentationController 
*)presentationController {
+    [self dismissAudioView:nil];
+}
+
 @end


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to