Skip to content

Commit dad765f

Browse files
committed
fix(ios): more bug fixes and improvements
1 parent 3dee096 commit dad765f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

packages/ui-cameraview/platforms/ios/src/NSCameraView.swift

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public class NSCameraView: UIView, NextLevelVideoDelegate, NextLevelPhotoDelegat
102102
return (self.nextLevel?.captureMode ?? NextLevelCaptureMode.photo).rawValue
103103
}
104104
set {
105-
self.nextLevel?.captureMode = NextLevelCaptureMode(rawValue: newValue)!
105+
captureModeBeforePhoto = NextLevelCaptureMode(rawValue: newValue)!
106+
self.nextLevel?.captureMode = captureModeBeforePhoto
106107
}
107108
}
108109

@@ -185,15 +186,15 @@ public class NSCameraView: UIView, NextLevelVideoDelegate, NextLevelPhotoDelegat
185186
}
186187
public func capturePhoto() {
187188
if let nextLevel = self.nextLevel , self.canCapturePhoto {
188-
if ( nextLevel.captureMode == NextLevelCaptureMode.photo) {
189+
// if ( nextLevel.captureMode == NextLevelCaptureMode.photo) {
189190
nextLevel.capturePhoto()
190-
} else {
191-
captureModeBeforePhoto = nextLevel.captureMode
192-
captureModeCompletionHandler = {
193-
nextLevel.capturePhoto()
194-
}
195-
nextLevel.captureMode = NextLevelCaptureMode.photo
196-
}
191+
// } else {
192+
// captureModeBeforePhoto = nextLevel.captureMode
193+
// captureModeCompletionHandler = {
194+
// nextLevel.capturePhoto()
195+
// }
196+
// nextLevel.captureMode = NextLevelCaptureMode.photo
197+
// }
197198
}
198199
}
199200
public func capturePhotoFromVideo() {
@@ -257,11 +258,7 @@ public class NSCameraView: UIView, NextLevelVideoDelegate, NextLevelPhotoDelegat
257258
}
258259

259260
public func nextLevelCaptureModeDidChange(_ nextLevel: NextLevel) {
260-
if (self.captureModeCompletionHandler != nil) {
261-
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100), execute: {
262-
self.captureModeCompletionHandler?()
263-
})
264-
}
261+
self.captureModeCompletionHandler?()
265262
}
266263

267264
// MARK: NextLevelPhotoDelegate

src/ui-cameraview/index.ios.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,18 @@ export class CameraView extends CameraViewBase {
268268
case 'videoWithoutAudio':
269269
intValue = 3;
270270
break;
271-
case 'movie':
271+
case 'videoPhotoWithoutAudio':
272272
intValue = 4;
273273
break;
274-
case 'arKit':
274+
case 'movie':
275275
intValue = 5;
276276
break;
277-
case 'arKitWithoutAudio':
277+
case 'arKit':
278278
intValue = 6;
279279
break;
280+
case 'arKitWithoutAudio':
281+
intValue = 7;
282+
break;
280283
default:
281284
case 'photo':
282285
intValue = 1;

0 commit comments

Comments
 (0)