diff --git a/ios/CameraHelper.h b/ios/CameraHelper.h index 45de67d5d9..4690a5ff5f 100644 --- a/ios/CameraHelper.h +++ b/ios/CameraHelper.h @@ -10,8 +10,7 @@ @property (nonatomic, strong) id delegate; -- (void) setCameraSize:(int)width h:(int)height; -- (void) startVideo; +- (void) startVideo:(int)width h:(int)height; - (void) stopVideo; @end diff --git a/ios/CameraHelper.mm b/ios/CameraHelper.mm index 86dc9f1aec..ffdb282365 100644 --- a/ios/CameraHelper.mm +++ b/ios/CameraHelper.mm @@ -37,7 +37,7 @@ NSString *getSelectedCamera() { if (granted) { NSLog(@"camera permission granted"); dispatch_async(dispatch_get_main_queue(), ^{ - [self startVideo]; + [self startVideo:mWidth h:mHeight]; }); } else { NSLog(@"camera permission denied"); @@ -56,14 +56,10 @@ NSString *getSelectedCamera() { } } --(void) setCameraSize: (int)width h:(int)height { - NSLog(@"CameraHelper::setCameraSize %dx%d", width, height); +-(void) startVideo: (int)width h:(int)height { + NSLog(@"CameraHelper::startVideo %dx%d", width, height); mWidth = width; mHeight = height; -} - --(void) startVideo { - NSLog(@"CameraHelper::startVideo"); if ([self checkPermission]) { return; } diff --git a/ios/ViewController.h b/ios/ViewController.h index fcacaff1ac..be207a839f 100644 --- a/ios/ViewController.h +++ b/ios/ViewController.h @@ -16,6 +16,5 @@ extern id sharedViewController; -void setCameraSize(int width, int height); -void startVideo(); +void startVideo(int width, int height); void stopVideo(); diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 224ee01fe6..d67ae849ee 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -382,12 +382,8 @@ extern float g_safeInsetBottom; } } -void setCameraSize(int width, int height) { - [cameraHelper setCameraSize: width h:height]; -} - -void startVideo() { - [cameraHelper startVideo]; +void startVideo(int width, int height) { + [cameraHelper startVideo: width h:height]; } void stopVideo() { diff --git a/ios/main.mm b/ios/main.mm index 94a0028668..5f12970d9d 100644 --- a/ios/main.mm +++ b/ios/main.mm @@ -429,8 +429,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string if (!strncmp(param1.c_str(), "startVideo", 10)) { int width = 0, height = 0; sscanf(param1.c_str(), "startVideo_%dx%d", &width, &height); - setCameraSize(width, height); - startVideo(); + startVideo(width, height); } else if (!strcmp(param1.c_str(), "stopVideo")) { stopVideo(); }