I'm using phonegap 1.2 in a ipad2 app. I need to use the camera facing front, not the main camera. When the API activates the camera it starts ok, but it uses then main camera on the back, and the user has to switch to the secondary camera in the front. I can't find any parameters in the Phonegap API that can select which camera to use.
I'm afraid this is not one of the PhoneGap's features for the moment. I suggest you take this up to the github issue tracker for iOS of it's something you are interested.
Related
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!
I'm been learning Swift and iOS development and am interested in making an application that uses the camera on the back of the iPhone to shoot slow motion video and then allow the user to use a slider to move through the video normally, but also to move frame by frame. Of course, this would be regulated by a button that transitioned the user from "normal navigation" to frame by frame. Can anyone point me in the right direction? Are there any resources where I can read about using the "slo-mo" feature in a custom app? Thanks.
If you don't want the user to be able to save the slow-mo video, what you could do is take a video shot, then have the app play it back in slow-mo. You can do all this using the AVFoundation framework. Here are some links to help you out:
Taking Control of the iPhone Camera in iOS 8
Objective-C: How to do slow-motion video in iOS (yes, this is for Objective-C, but you can change the code to Swift or just copy and paste it into a new Objective-C file)
I'm making an app that has to set off the camera. Does this have to be done with user interaction? Or can I just call a function? It seems like it has to be possible. It looks like Snapchat does it because it has it's own camera UI (FYI I'm using swift and am very new to iOS programming. I've been at it for about a week, but I have JS experience)
You will need to implement your own Camera functionality from scratch using AVFoundation. This is how apps like Snapchat work.
Start here:
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW2
I have a Mobile web page (on an iPhone), where-in I have a button called ‘launch camera’. Clicking on this button in Safari browser, will launch native device camera. It is done using this code, . It runs like a pure web application. Now, I want to introduce augmented reality way of displaying video. When I track an image using device camera, it should play a respected video. I have earlier done this natively integrated with Metaio, Qualcomm vuforia etc. But, I need to do this in the mobile web page, not through native or hybrid, my requirement is that. How can I integrate scan (track) an image and play respected video an augmented reality way through a Mobile web page and device camera?
Please advise!
It's currently not possible. iOS browser won't let you access the live image from your camera and draw on top of the view finder.
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