[TIMOB-15976] iOS: Turning the camera around using Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT) causing camera to get stuck and refuse to snap a picture
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-08-11T20:02:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.0 |
Components | iOS |
Labels | Ti.Media.switchCamera, camera, ios, picture, qe-6.0.0 |
Reporter | Stevo Perisic |
Assignee | Angel Petkov |
Created | 2013-11-07T14:35:06.000+0000 |
Updated | 2016-09-22T18:49:42.000+0000 |
Description
Turning the camera around using Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT) and subsequently trying to snap a picture using Ti.Media.takePicture(); causes the camera to freeze/get stuck and this error is shown in the iPad console:
UIImagePickerController: ignoring request to take picture; camera is changing modes.
Hello Stevo, can you please provide a testcase and a log? TIA! Best, Mauro
The issue is not reproducible with the sample code posted below. When I switch views and press the "Take Picture" button, I get the expected output and do not see any errors or freezing. Can you please try this sample to see if you get the error on your device? Please keep us posted with an update.
Test Device:
iPad with 7.0.4.Sample Code
Here is the code I used and you can reproduce every time, the user clicks the take photo button fast, Titanium 3.1.3.GA, iPad 7.0.2:
When testing the above code on an iPad (7.0.4), I was able to reproduce the issue. If I immediately tap the "Take Photo" button after tapping the "Start Camera" button then the app will take a picture, but the next time I try to start the camera and take a picture, I am unable to tab the "Take Photo" button. I was also able to reproduce this on an iPhone 5 running 7.0.3. Escalating this ticket to bugs.
Verified as fixed, using the provided test code, I not able to reproduce the error. Tested On: iPhone 6 Plus 10.0.1 Device iPhone 5S 9.3.5 Device Mac OSX El Capitan 10.11.6 Ti SDK: 6.0.0.v20160921191053 Appc Studio: 4.8.0.201609101003 Appc NPM: 4.2.8-6 App CLI: 6.0.0-45 Xcode 8.0 Node v4.4.7 *Closing ticket.*