I wrote an application that sets some camera values (duration, quality, etc) using UIImagePickerController and it works fine. However, on an iPhone 4, I start with the front camera and if the user switches to the rear camera, the quality settings are lost. Is there a way that I can test if the user switches between the front and rear camera?
By using
if (imagePicker.cameraDevice=UIImagePickerControllerCameraDeviceFront)
it will tell me if the camera is set to the front camera but if the user switches cameras using the screen switcher, it won't return the camera value.
Any help here would be greatly appreciated.
You probably need AVCaptureDevice notifications:
AVCaptureDeviceWasDisconnectedNotification
AVCaptureDeviceWasConnectedNotification
Observe them and react accordingly.
Related
I am trying to take photos while the camera is connected to the computer. As soon as the camera is connected to to PC the camera changes it's mode to busy. I would like trigger the camera to take picture while it is connected to the computer.
You can use the EdsSendStatusCommand function with kEdsCameraStatusCommand _UIUnLock to use the camera manually while plugged in. Note that some commands issued with the Canon SDK may lock the camera UI again.
I am developing this app for ipad and ios9 and at some point the user will click on a button to watch a video. But I wouldn't want the user to just see it in the split view size he's currently on (like 1/3rd or 14th) instead I would like the app to close the other open app and for it to take over the entire screen.
Does anyone know if that's possible? Thanks.
By-default, the video always get played in full-screen mode. When video playing is finished, the player gets dismissed and you will see your screen (from where you played the video). In your case, in split view controller.
Do let me know if you need further details.
I am making a app that, in its course, can take a picture with the rear camera and immediately take a picture with the front camera 3 seconds after. I do this by dismissing the previous UIImagePickerController and presenting a UIImagePickerController, where in the completion block of the presentViewController:animated:completion: method I start an NSTimer that calls takePicture after 3 seconds.
This worked like a charm in iOS 7. In iOS 8 however I fail to see the front camera view and I receive this in the console:
UIImagePickerController: ignoring request to take picture; camera is changing modes.
What is going on here? Was there an API change? Or is this a x.0 bug?
If any code is needed to help me out I will gladly provide it.
We need to open the iPhone camera, to take images that will be saved to the camera roll.
I have read many examples here that all of them opens the UIImagePickerView.
Besides the fact that i cant understand why i have to open the picker view in order to open the camera , i just can't do that- i dont want the picker view, because i have my costumed photo album that we build, and we just need to have a little button in it, that opens the camera to take an image . without opening any other views above it .
Is that possible to use the camera without this pickerview that will cover my scene ?
or can i lead the user to the camera app and than take him back to my app ?
Thanks.
Instead of high level (i.e. Apple supplies the UI element) classes, you have to go to a more foundational (lower) level of API's, which would be AVCaptureDevice and AVCaptureDeviceInput.
And Apple has some nice source code available in their AVCam project.
If you want to display camera stream in you app without UIImagePickerController than you should you AVFoundation framework.
Here some some examples and tutorials:
take-photos-with AVFoundation
Custom camera
Displaying camera
I have an application that plays video from local disk and when a second screen is connected (through AV composite cable) it switch the movie view to the external screen. this is working fine so far. what I want is, when the user press the home button and the app goes to background mode; I want to continue playing the video in the second screen while the app is running in the background mode. this works for audio, as I have set my application to continue play audio in background mode and it is working fine: the audio continue to play in the background mode fine. now is it possible to continue play video as well, and how?
This is not possible. It is outside of the scope of an iOS app to continue powering a screen while it is in the background.