{ "id": "122191", "key": "TIMOB-15976", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-11T20:02:03.000+0000", "created": "2013-11-07T14:35:06.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Ti.Media.switchCamera", "camera", "ios", "picture", "qe-6.0.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-09-22T18:49:42.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "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:\r\n\r\nUIImagePickerController: ignoring request to take picture; camera is changing modes.", "attachment": [], "flagged": false, "summary": "iOS: Turning the camera around using Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT) causing camera to get stuck and refuse to snap a picture", "creator": { "name": "stevo.perisic@gmail.com", "key": "stevo.perisic@gmail.com", "displayName": "Stevo Perisic", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "stevo.perisic@gmail.com", "key": "stevo.perisic@gmail.com", "displayName": "Stevo Perisic", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.1.3.GA, Xcode 5.0.1 (5A2053), Xcode 5.0.2, iPad (7.0.4 & 7.0.3), iPhone 5 (7.0.3)", "closedSprints": [ { "id": 685, "state": "closed", "name": "2016 Sprint 16 SDK", "startDate": "2016-07-30T00:40:02.939Z", "endDate": "2016-08-13T00:40:00.000Z", "completeDate": "2016-08-15T08:00:33.056Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "280453", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello Stevo,\r\ncan you please provide a testcase and a log? \r\n\r\nTIA! \r\n\r\nBest,\r\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-21T01:27:28.000+0000", "updated": "2013-11-21T01:27:28.000+0000" }, { "id": "282438", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "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.\r\n\r\nh5. Test Device:\r\niPad with 7.0.4.\r\n\r\nh5. Sample Code\r\n{code}\r\ncontainer = {};\r\ncontainer.win = Titanium.UI.createWindow();\r\n\r\ncontainer.button = Titanium.UI.createButton({\r\n\tcolor : '#fff',\r\n\tbackgroundImage : '/images/BUTT_grn_on.png',\r\n\tbackgroundSelectedImage : '/images/BUTT_grn_off.png',\r\n\tbackgroundDisabledImage : '/images/BUTT_gry_on.png',\r\n\tbottom : 10,\r\n\twidth : 301,\r\n\theight : 57,\r\n\tfont : {\r\n\t\tfontSize : 20,\r\n\t\tfontWeight : 'bold',\r\n\t\tfontFamily : 'Helvetica Neue'\r\n\t},\r\n\ttitle : 'Take Picture'\r\n});\r\n\r\ncontainer.overlay = Titanium.UI.createView();\r\ncontainer.overlay.add(container.button);\r\n\r\ncontainer.button.addEventListener('click', function() {\r\n\r\n\tTi.Media.takePicture();\r\n\r\n});\r\n\r\ncontainer.switchCamera = Titanium.UI.createButton({\r\n\tcolor : '#fff',\r\n\tbackgroundImage : '/images/BUTT_grn_on.png',\r\n\tbackgroundSelectedImage : '/images/BUTT_grn_off.png',\r\n\tbackgroundDisabledImage : '/images/BUTT_gry_on.png',\r\n\ttop : 10,\r\n\twidth : 301,\r\n\theight : 57,\r\n\tfont : {\r\n\t\tfontSize : 20,\r\n\t\tfontWeight : 'bold',\r\n\t\tfontFamily : 'Helvetica Neue'\r\n\t},\r\n\ttitle : 'switch Camera'\r\n});\r\ncontainer.overlay.add(container.switchCamera);\r\ncontainer.switchCamera.addEventListener('click', function() {\r\n\r\n\tTi.Media.switchCamera(Ti.Media.CAMERA_FRONT);\r\n\r\n});\r\n\r\nTitanium.Media.showCamera({\r\n\r\n\tsuccess : function(event) {\r\n\t\tTi.API.debug(\"picture was taken\");\r\n\r\n\t\t// place our picture into our window\r\n\t\tvar imageView = Ti.UI.createImageView({\r\n\t\t\timage : event.media,\r\n\t\t\twidth : container.win.width,\r\n\t\t\theight : container.win.height\r\n\t\t});\r\n\t\tcontainer.win.add(imageView);\r\n\r\n\t\t// programatically hide the camera\r\n\t\t//Ti.Media.hideCamera();\r\n\t},\r\n\tcancel : function() {\r\n\t},\r\n\terror : function(error) {\r\n\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\ttitle : 'Camera'\r\n\t\t});\r\n\t\tif (error.code == Titanium.Media.NO_CAMERA) {\r\n\t\t\ta.setMessage('Please run this test on device');\r\n\t\t} else {\r\n\t\t\ta.setMessage('Unexpected error: ' + error.code);\r\n\t\t}\r\n\t\ta.show();\r\n\t},\r\n\toverlay : container.overlay,\r\n\tshowControls : false, // don't show system controls\r\n\tmediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,\r\n\tautohide : false // tell the system not to auto-hide and we'll do it ourself\r\n});\r\ncontainer.win.open();\r\n\r\n{code}", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-04T18:52:29.000+0000", "updated": "2013-12-05T21:59:27.000+0000" }, { "id": "283055", "author": { "name": "stevo.perisic@gmail.com", "key": "stevo.perisic@gmail.com", "displayName": "Stevo Perisic", "active": true, "timeZone": "America/Los_Angeles" }, "body": "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:\n\n{code:title=index.js|borderStyle=solid}\nvar overlay = Ti.UI.createView({\n\twidth: Ti.UI.FILL,\n\theight: Ti.UI.FILL,\n\tbackgroundColor: 'transparent'\n});\n\nvar takePhotoBtn = Ti.UI.createButton({\n\twidth: '200dp',\n\theight: '60dp',\n\tbottom: '100dp',\n\tbackgroundColor: '#FFF'\n});\n\nvar btnLbl = Ti.UI.createLabel({\n\ttext: 'Take Photo'\n});\n\ntakePhotoBtn.addEventListener('click', function(e){\n\tTi.Media.takePicture()\n});\n\ntakePhotoBtn.add(btnLbl);\noverlay.add(takePhotoBtn);\n\n$.back.addEventListener('click', showCamera);\n\n$.index.open();\n\nfunction showCamera(){\n\tTi.Media.showCamera({\n\t\tsuccess: function(event){\n\t\t\tvar imageData = event.media;\n\t\t\t$.resultImg.setImage(imageData);\n\t\t\tTi.Media.hideCamera();\n\t\t},\n\t\terror: function(error){\n\t\t\tTi.API.info('Error: ' + JSON.stringify(error));\n\t\t},\n\t\toverlay : overlay,\n\t\tsaveToPhotoGallery: false,\n\t\tallowEditing: false,\n\t\tmediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO],\n\t\tshowControls : false,\n\t\tautohide : false,\n\t\t//make the picture inside the camera smaller so that we \n\t\t//can than place an overlay around it\n\t\ttransform: Ti.UI.create2DMatrix({\n\t\t\tscale : 0.5\n\t\t})\n\t});\n\n\tTi.Media.switchCamera(Ti.Media.CAMERA_FRONT);\t\n}\n\n{code} \n\n{code:title=index.xml|borderStyle=solid}\n\n\t\n\t\t