{ "id": "164989", "key": "TIMOB-24214", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2018-07-27T17:38:53.000+0000", "created": "2016-12-12T22:40:28.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [], "assignee": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-07-27T17:38:53.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": "h2 Issue Description\r\n\r\nTrying to increase the limit size and quality of videos it's capturing is not working using:\r\n{code}\r\nfunction showCamera_Android(e) {\r\n Ti.Media.showCamera({\r\n\t\tsuccess : onMediaSuccess,\r\n\t\tcancel \t: onMediaCancel,\r\n\t\terror \t: onMediaError,\t\r\n\t\tsaveToPhotoGallery \t: true,\r\n\t\tallowEditing \t: true,\r\n\t\tvideoMaximumDuration : 5000,\r\n\t\tvideoQuality\t: Ti.Media.QUALITY_MEDIUM,\r\n\t\tmediaTypes \t: [Ti.Media.MEDIA_TYPE_VIDEO]\r\n});\r\n{code}\r\nworks on iOS and Android 5, but not using 6. \r\n\r\nCreating Intents is also not working:\r\n{code}\r\nfunction showCamera_Android()\r\n{\r\n\tvar intent = Titanium.Android.createIntent({ action: 'android.media.action.VIDEO_CAPTURE' });\r\n\r\n\r\n\t/*\r\n\t * THESE INTENTS ARE NOT WORKING\r\n\t * \r\n\t */\r\n\r\n\tintent.putExtra(\"android.provider.MediaStore.EXTRA_VIDEO_QUALITY\",0);\r\n intent.putExtra(\"android.provider.MediaStore.EXTRA_DURATION_LIMIT\",3);\r\n\r\n\t/*\r\n\t * THESE INTENTS ARE NOT WORKING EITHER\r\n\t * \r\n\t */\r\n\t// intent.putExtra(\"android.intent.extra.durationLimit\", 3);\r\n\t// intent.putExtra(\"android.intent.extra.videoQuality\", 0); \r\n\r\n $.winMain.getActivity().startActivityForResult(intent, function(e) {\r\n \r\n \r\n if (e.error) \r\n {\r\n } \r\n else \r\n {\r\n \tif (e.resultCode === Titanium.Android.RESULT_OK) {\r\n \t\t\r\n\t \tvar videoUri \t= e.intent.data;\r\n\t var source \t\t= Ti.Filesystem.getFile(videoUri);\r\n\t\t\t var movieFile \t= Ti.Filesystem.getFile('appdata://sample.3gp');\r\n\t\t\t\r\n\t\t\t\tif (movieFile.exists()) \r\n\t\t\t\t\tmovieFile.deleteFile();\r\n\t\t\t\t\r\n\t\t\t\tmovieFile \t= Ti.Filesystem.getFile('appdata://sample.3gp');\r\n\t\t\t\t\r\n\t\t\t source.copy(movieFile.nativePath);\r\n\t\t\t videoBlob = movieFile;\r\n\t\t\t\t\r\n\t\t\t\tvar buffer = Ti.createBuffer({ value: \"test\"});\r\n\t\t\t\timgBlob = buffer.toBlob();\r\n\t\t\t\t\r\n\t\t\t\t$.vidPlayer.url = videoUri;\r\n\t \t$.vidPlayer.play();\t\r\n\t \t\r\n\t }\r\n }\r\n \r\n });\r\n}\r\n{code}\r\n\r\nh6. Steps to reproduce\r\n# Download the attached zip https://drive.google.com/open?id=0BwTWo-c2a0b9UlJVdTRvQkI3VUU\r\n# Run for android6 \r\n# Record video ", "attachment": [], "flagged": false, "summary": "Android: VideoMaximumDuration and VideoQuality are not working using Android 6", "creator": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 6 \r\nCLI 6.0.0 \r\nSDK 6.0.0 \r\nMac OS 10.12.1\r\nNodeJS 4.6.0 \r\nNpm 2.15.9\u001b", "closedSprints": [ { "id": 796, "state": "closed", "name": "2017 Sprint 02 SDK", "startDate": "2017-01-15T00:00:41.845Z", "endDate": "2017-01-29T00:00:00.000Z", "completeDate": "2017-01-30T21:10:44.640Z", "originBoardId": 114 }, { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "403310", "author": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Seems like a permission error. For 23+ API (Android 6), you need to explicitly ask for permissions for use of features. So for video recording it would be:\r\n\r\nIn {{AndroidManifest.xml}}\r\n{code:XML}\r\n\r\n\r\n\r\n{code}\r\n\r\nPlease use that workaround for now while I fix this. :)\r\n", "updateAuthor": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-12-13T22:27:56.000+0000", "updated": "2016-12-13T22:27:56.000+0000" }, { "id": "404314", "author": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "body": "You need to add permissions in {{tiapp.xml}} #android #manifest tag. When the android app is generated, those will be inserted into #manifest tag in {{AndroidManifest.xml}}. No permission will be granted on Android if it's not in the AndroidManifest.xml. After that the user needs to enable simply permissions. [~rramirez].", "updateAuthor": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-01-09T23:47:51.000+0000", "updated": "2017-01-09T23:51:19.000+0000" }, { "id": "406163", "author": { "name": "rtrueman", "key": "rtrueman", "displayName": "Rob Trueman", "active": true, "timeZone": "America/New_York" }, "body": "The problem isn't with access to the camera, but in the maximum video duration and quality. My initial app permissions include:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nI also added: \r\n\r\n\r\n\r\nafter finding this ticket, but it didn't help. Are you able to limit the video length? ", "updateAuthor": { "name": "rtrueman", "key": "rtrueman", "displayName": "Rob Trueman", "active": true, "timeZone": "America/New_York" }, "created": "2017-02-02T16:52:42.000+0000", "updated": "2017-02-02T16:52:42.000+0000" }, { "id": "412459", "author": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~rtrueman], you can limit video length by changing the videoMaximumDuration value which is uses ms as a measurement unit. I still could not reproduce error using Samsung Galaxy S6 and latest Titanium SDK version (master). Here is the app code:\r\n\r\n{code:JavaScript}\r\nvar win;\r\nfunction fireCamera() {\r\n\tif (Ti.Platform.osname === 'android' || Ti.Platform.osname == \"iphone\" || Ti.Platform.osname == 'ipad') {\r\n\t\twin.removeEventListener('focus', fireCamera);\r\n\t}\r\n\tTitanium.Media.showCamera({\r\n\r\n\t\tsuccess: function (event) {\r\n\t\t\tvar cropRect = event.cropRect;\r\n\t\t\tvar image = event.media;\r\n\r\n\t\t\tif (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {\r\n\t\t\t\tvar imageView = Ti.UI.createImageView({\r\n\t\t\t\t\twidth: win.width,\r\n\t\t\t\t\theight: win.height,\r\n\t\t\t\t\timage: event.media\r\n\t\t\t\t});\r\n\t\t\t\twin.add(imageView);\r\n\t\t\t}\r\n\t\t},\r\n\t\tcancel: function () {\r\n\r\n\t\t},\r\n\t\terror: function (error) {\r\n\t\t\tif (error.code == Titanium.Media.NO_CAMERA) {\r\n\t\t\t\tconsole.log(\"\", \"device has no camera\", error)\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconsole.log(error.code, \"unexpected error\", error);\r\n\t\t\t}\r\n\t\t},\r\n\t\tsaveToPhotoGallery: true,\r\n\t\tallowEditing: true,\r\n\t\tvideoMaximumDuration: 2000,\r\n\t\tvideoQuality: Ti.Media.QUALITY_MEDIUM,\r\n\t\tmediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO]\r\n\t});\r\n}\r\nwin = Titanium.UI.createWindow({\r\n\ttitle: \"classic_app\"\r\n});\r\nwin.open();\r\nif (Ti.Platform.osname === 'android' || Ti.Platform.osname == \"iphone\" || Ti.Platform.osname == 'ipad') {\r\n\twin.addEventListener('focus', fireCamera);\r\n} else {\r\n\tfireCamera();\r\n}\r\n{code}\r\n", "updateAuthor": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-15T01:03:23.000+0000", "updated": "2017-03-15T01:03:23.000+0000" }, { "id": "420253", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tried to reproduce the issue using both the attached app & the code by [~fmerzadyan] & what I see is the video does not auto stop recording after the {{VideoMaximumDuration}} is elapsed or restricts the recording to the given duration. Also, the for me the {{VideoQuality}} always comes out to be the highest.\r\n\r\nStudio Ver: 4.9.0.201705180402\r\nSDK Ver: 6.0.4.GA\r\nOS Ver: 10.12.3\r\nXcode Ver: Xcode 8.3.2\r\nAppc NPM: 4.2.9\r\nAppc CLI: 6.2.1\r\nTi CLI Ver: 5.0.13\r\nAlloy Ver: 1.9.11\r\nNode Ver: 6.10.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ oneplus A0001 --- Android 6.0.1\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-23T18:48:14.000+0000", "updated": "2017-05-23T18:49:30.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }