{ "id": "123026", "key": "TIMOB-15844", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-12-03T17:31:57.000+0000", "created": "2013-11-28T06:52:41.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-3.2.0" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2017-03-28T21:19:52.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Android: Media: Unable to switch to front camera\r\nIssue occurs on SDK: 3.1.3.GA as well.\r\n\r\nSteps to reproduce:\r\n1. Run the below app.\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'white',\r\n\tlayout:'vertical'\r\n}); \r\n\t// create button, register the modified click callback, add button to window\r\n\t\tfunction addButton(title, clickCallback)\r\n\t\t{\r\n\t\t\tvar button = Ti.UI.createButton({title:title, width:'300', height:'50'});\r\n\t\t\t\r\n\t\t\tbutton.addEventListener('click', function() {\r\n\t\t\t\tTi.Media.showCamera({mediaType:Ti.Media.MEDIA_TYPE_PHOTO});\r\n\t\t\t\tclickCallback();\r\n\t\t\t\tTi.Media.vibrate();\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\twin.add(button);\r\n\t\t}\r\n\t\t\r\n\t\t// camera with no switch\r\n\t\taddButton('Default Camera', function(){\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t// camera with front specified\r\n\t\taddButton('Front Camera Test 1', function(){\r\n\t\t\tTi.Media.switchCamera(Ti.Media.CAMERA_FRONT);\r\n\t\t});\r\n\t\t\r\n\t\t// camera with front specified after switching to back\r\n\t\t// checks if switch function actually works, opposed to it being the default\r\n\t\taddButton('Front Camera Test 2', function(){\r\n\t\t\tTi.Media.switchCamera(Ti.Media.CAMERA_REAR);\r\n\t\t\tTi.Media.switchCamera(Ti.Media.CAMERA_FRONT);\r\n\t\t});\r\n\t\t\r\n\t\t// camera with back specified\r\n\t\taddButton('Back Camera Test 1', function(){\r\n\t\t\tTi.Media.switchCamera(Ti.Media.CAMERA_REAR);\r\n\t\t});\r\n\t\t\r\n\t\t// camera with back specified after switching to front\r\n\t\t// checks if switch function actually works, opposed to it being the default\r\n\t\taddButton('Back Camera Test 2', function(){\r\n\t\t\tTi.Media.switchCamera(Ti.Media.CAMERA_FRONT);\r\n\t\t\tTi.Media.switchCamera(Ti.Media.CAMERA_REAR);\r\n\t\t});\r\n\t\t\r\n\t\t// camera passed invalid (non-existent) argument\r\n\t\taddButton('Invalid Camera', function(){\r\n\t\t\tTi.Media.switchCamera(undefined);\r\n\t\t});\r\n\t\t\r\n\t\r\n\t\twin.open();\r\n\r\n{code}\r\n\r\n2. Click 'Front Camera Test 1'\r\n\r\nExpected:\r\nFront Camera should be open.\r\n\r\nActual:\r\nUnable to switch, front camera is opened.\r\nLogs occurs as \"\r\n[ERROR] : TiMedia: (KrollRuntimeThread) [14139,14139] Camera preview is not open, unable to switch camera.\r\n[ERROR] : TiMedia: (KrollRuntimeThread) [1,14140] Camera preview is not open, unable to switch camera.\r\n[WARN] : IInputConnectionWrapper: showStatusIcon on inactive InputConnection\r\n[WARN] : IInputConnectionWrapper: showStatusIcon on inactive InputConnection\r\n[ERROR] : TiMedia: (KrollRuntimeThread) [13464,27604] Camera preview is not open, unable to switch camera.\r\n[WARN] : IInputConnectionWrapper: showStatusIcon on inactive InputConnection\r\n\"", "attachment": [], "flagged": false, "summary": "Android: Media: Unable to switch to front camera", "creator": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "Tested on:\r\nDevice : Samsung S2, Android version: 4.1.2\r\nDevice: Samsung S3, Android version: 4.1.2\r\nSDK: 3.2.0.v20131127194046\r\nCLI version : 3.2.0-beta\r\nOS : MAC OSX 10.9\r\nAlloy: 1.3.0\r\nACS: 1.0.8\r\nAppcelerator Studio, build: 3.2.0.201311261642\r\ntitanium-code-processor: 1.1.0-beta\r\nXCode : 5.0.2", "comment": { "comments": [ { "id": "281795", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "actually switching is working if you add an overlay with a button and switch after the camera is open. But you can't start directly with the front facing camera. Verified on Nexus 4 (3.2 Beta)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-11-28T17:43:55.000+0000", "updated": "2013-11-28T17:43:55.000+0000" }, { "id": "282136", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Camera can be switched only with custom overlay. With custom overlay, one can set 'whichCamera' option in the 'showCamera' options to set the default type.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-12-03T17:31:57.000+0000", "updated": "2013-12-03T17:31:57.000+0000" }, { "id": "416064", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T21:19:52.000+0000", "updated": "2017-03-28T21:19:52.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }