Camera preview is missing while using torch on web view - ios

We have QR-scanner feature implemented on web view (WKWebView). If it's dark we want to light our QR-code using flashlight in iPhone. In general, this feature works, but without flashlight.
But have that problems:
If we turn on torch then camera preview disappears.
If turn off torch then camera preview appears.
Do you have any idea why it's so? And how can we sort it out?

Related

Picture in Picture camera swift

I'm trying to get the Picture in Picture working for my camera view on my iPad.
I see on the documentation that we can do it more easily on iOS 16 for video calls.
The result I'm trying to get is to be able to see the camera of the user in PiP while being in the background.
One way of doing that is to fake a video call (like Zoom, Messenger, etc) but that seems overkill. I am able to view my video using UIImagePickerController but I'm wondering if there is an easy way to integrate it in PiP?

Video Preview Layer Running While in Split-View?

I currently have an app that displays the front facing camera atop a video preview layer. By default in iOS 9, the preview layer is interrupted/paused and will not resume until split-view is dismissed. Based on the nature of the app, maintaining the running camera preview layer while multitasking is essential.
Is there any way to force the capture session to continue previewing while in split view?
Update: Seems as if Apple does not allow any sort of camera use while the device has more than one application open. You can, however, invoke UIImagePickerController in order to take a photo while in split-view. Of course this solution only allows you to snap a single photo, and nothing more. Hope this helps someone!

Achieving seamless front/back camera switching with AVFoundation

I'm developing a photo app using AVFoundation and when I switch from front to rear camera (and vice-versa), I've noticed my AVCaptureVideoPreviewLayer is briefly darkened immediately after the switch. It's not an enormous deal, but it does make the transition look very amateurish. Has anyone else experienced this/found a solution?

iOS App: AVFoundation Video camera recording delegates

I am trying to develop an app that records the video using the rear camera.
I want the video to be tweaked (adding overlay image, green screen) before saving it to a file.
I am using AVFoundation, and have researched anywhere, but I still cant make the correct codes to preview and record (without the tweaking)
Some codes that Iget from the internet use BufferDelegate, the rest are using RecordingDelegate.
Do I need to use both to achieve what I want? or is it just one ofthem?
Could you please pinpoint me how I can achieve this?

Capture front-facing camera - Phonegap?

How to capture video from front-facing camera, using Phonegap?
I found this navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2}); in Phonegaps API docs online. But I dont see anything about using the front camera instead of rear. Is it possible?
I think after the camera opens up, u can choose the front camera. Currently i dont think so there is an option to open the front camera by default
If your smartphone have front and back camera, when you use
navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
capture camera will be opened with switch button automatically.
I was playing around with PhoneGap today since I had an idea for an app. For this idea I needed the front facing camera aswell to be selected as default. After trying different things I found a work around which selected the front facing camera by default [NOTE: this is a dirty fix, I've got no clue what happens on devices without a front facing camera!]
In Xcode (or whatever editor you use) open [ProjectName]/plugins/CDVCapture.m and locate both captureImage and captureVideo. Both functions/commands have a line saying
pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
Add this line below:
pickerController.cameraDevice = UIImagePickerControllerCameraDeviceFront;
And both Video and Image capturing will select the front facing camera by default when opening up the camera app. However, the user still has the possibility to switch cameras.
Here's a pastebin with my full CVDCapture.m file: http://pastebin.com/kkkyiPdn

Resources