{ "id": "63996", "key": "TIMOB-3364", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2011-11-03T15:19:03.000+0000", "created": "2011-04-15T03:43:18.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "13754", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "63768", "key": "TIMOB-3136", "fields": { "summary": "iOS: Bug MediaModule.m Front/Rear Camera", "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" } }, "priority": { "name": "Trivial", "id": "5" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T22:49:18.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": "{html}

I use following code:

\n
\n       Ti.Media.switchCamera(Ti.Media.CAMERA_REAR);\n\n    if (Ti.Media.camera == Ti.Media.CAMERA_REAR)\n    {\n        Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT);\n    }\n
\n

but it does not help me to open front camera first instead of\nback camera.

\n

I get -- [ERROR] invalid state. in -[MediaModule\nswitchCamera:] (MediaModule.m:644)

\n

please help me to solve this issue.

{html}", "attachment": [], "flagged": false, "summary": "How to open front camera first in iphone4 instead of backside camera?", "creator": { "name": "bhavyahmehta", "key": "bhavyahmehta", "displayName": "bhavyahmehta", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhavyahmehta", "key": "bhavyahmehta", "displayName": "bhavyahmehta", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130615", "author": { "name": "andrewskinner", "key": "andrewskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I believe the \"invalid state\" error only happens in the\nsimulator, since there is no camera to switch. However, I can\nconfirm that switchCamera does nothing on the device either.

{html}", "updateAuthor": { "name": "andrewskinner", "key": "andrewskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:43:19.000+0000", "updated": "2011-04-15T03:43:19.000+0000" }, { "id": "130616", "author": { "name": "andrewskinner", "key": "andrewskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

So, a couple of bugs lead to switchCamera not working quite\nright.

\n

One, the constants for CAMERA_FRONT and CAMERA_REAR are flipped\n(so FRONT refers to Rear, and REAR refers to FRONT).

\n

Lines 451-452 of MediaModule.m should be:

\n
\nMAKE_SYSTEM_PROP(CAMERA_FRONT,UIImagePickerControllerCameraDeviceFront);\nMAKE_SYSTEM_PROP(CAMERA_REAR,UIImagePickerControllerCameraDeviceRear);\n
\n

Also, the code calls a setCameraDevice function, which does not\nexist. Instead I think you need to set the cameraDevice property of\nthe picker.

\n

So, line 669 of MediaModule.m should be:

\n
\npicker.cameraDevice = [TiUtils intValue:args];\n
\n

Hopefully easy fixes! Hope to see them in soon.

{html}", "updateAuthor": { "name": "andrewskinner", "key": "andrewskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:43:19.000+0000", "updated": "2011-04-15T03:43:19.000+0000" }, { "id": "171409", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Duplicates. The root issue is front and back are switched in the module.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-11-03T15:18:55.000+0000", "updated": "2011-11-03T15:18:55.000+0000" }, { "id": "410844", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T22:49:18.000+0000", "updated": "2017-03-09T22:49:18.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }