{ "id": "171087", "key": "TIMOB-25770", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-02T18:19:34.000+0000", "created": "2018-02-12T16:39:26.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "56308", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "168972", "key": "TIMOB-25020", "fields": { "summary": "Android: requestThumbnailImagesAtTimes causes a crash", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-06-11T14:13: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": "Requesting a thumb from a video payer that has a remote video loaded results in a crash.\r\n\r\nTest case:\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({layout:'vertical'}),\r\n buttonCamera = Ti.UI.createButton({title: \"Camera\"}),\r\n buttonGallery = Ti.UI.createButton({title: \"Gallery\"}),\r\n buttonLocalURL = Ti.UI.createButton({title: \"Local\"}),\r\n buttonRemoteURL = Ti.UI.createButton({title: \"Remote\"}),\r\n buttonLayout = Ti.UI.createView({bottom: 20, layout:'horizontal'}),\r\n slider = Ti.UI.createSlider({top: 30, backgroundColor: 'gray', min: 0, max: 100, width: '100%', touchEnabled: false, enabled: false}),\r\n videoPlayer = Ti.Media.createVideoPlayer({top: 20, height:'30%', autoplay: false}),\r\n imageView = Ti.UI.createImageView({top: 20, height:'30%'}),\r\n updatingThumbnail = false;\r\n\r\nbuttonLayout.add([buttonCamera, buttonGallery, buttonLocalURL, buttonRemoteURL]);\r\nwin.add(videoPlayer);\r\nwin.add(imageView);\r\nwin.add(slider);\r\nwin.add(buttonLayout);\r\nwin.open();\r\n\r\nslider.addEventListener('change', function(e) {\r\n if (videoPlayer && e.value > 0 && !updatingThumbnail) {\r\n updatingThumbnail = true;\r\n videoPlayer.requestThumbnailImagesAtTimes([e.value], Ti.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME, function(response) {\r\n imageView.image = response.image;\r\n updatingThumbnail = false;\r\n });\r\n }\r\n});\r\n\r\nvideoPlayer.addEventListener('durationavailable', function() {\r\n enableGetThumbSlider();\r\n});\r\n\r\nbuttonCamera.addEventListener('click', recordVideo);\r\n\r\nfunction recordVideo() {\r\n disableGetThumbSlider();\r\n var permissionsToRequest = [];\r\n var cameraPermission = \"android.permission.CAMERA\";\r\n var hasCameraPerm = Ti.Android.hasPermission(cameraPermission);\r\n if (!hasCameraPerm) {\r\n permissionsToRequest.push(cameraPermission);\r\n }\r\n\r\n var storagePermission = \"android.permission.READ_EXTERNAL_STORAGE\";\r\n var hasStoragePerm = Ti.Android.hasPermission(storagePermission);\r\n if (!hasStoragePerm) {\r\n permissionsToRequest.push(storagePermission);\r\n }\r\n\r\n if(permissionsToRequest.length > 0) {\r\n Ti.Android.requestPermissions(permissionsToRequest, function (e) {\r\n if (e.success) {\r\n showCamera();\r\n }\r\n });\r\n } else {\r\n showCamera();\r\n }\r\n}\r\n\r\nfunction showCamera() {\r\n Ti.Media.showCamera({\r\n autohide: false,\r\n animated: false,\r\n allowEditing: false,\r\n success:function(event) {\r\n videoPlayer.url = event.media.nativePath;\r\n },\r\n cancel:function() {\r\n console.log(\"cancel\");\r\n },\r\n error:function(error) {\r\n console.log(\"error\");\r\n console.log(error);\r\n },\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],\r\n });\r\n}\r\n\r\nbuttonLocalURL.addEventListener(\"click\", function() {\r\n disableGetThumbSlider();\r\n videoPlayer.url = 'BigBuckBunny_320x180.mp4';\r\n});\r\n\r\nbuttonRemoteURL.addEventListener(\"click\", function() {\r\n disableGetThumbSlider();\r\n videoPlayer.url = 'http://ve-ep.ember.ltd/assets/media/qa/samplevideo-1280x720-5mb.mp4';\r\n});\r\n\r\nbuttonGallery.addEventListener(\"click\", function() {\r\n disableGetThumbSlider();\r\n var intent = Ti.Android.createIntent({\r\n action: Ti.Android.ACTION_PICK,\r\n type: \"video/*\"\r\n });\r\n intent.addCategory(Ti.Android.CATEGORY_DEFAULT);\r\n win.getActivity().startActivityForResult(intent, function(e) {\r\n if (e.intent != null) {\r\n videoPlayer.url = e.intent.data;\r\n }\r\n });\r\n});\r\n\r\nfunction disableGetThumbSlider() {\r\n slider.touchEnabled = false;\r\n slider.enabled = false;\r\n}\r\n\r\nfunction enableGetThumbSlider() {\r\n slider.touchEnabled = true;\r\n slider.enabled = true;\r\n}\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: requestThumbnailImagesAtTimes() does not work with remote content", "creator": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "subtasks": [], "reporter": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "environment": null, "closedSprints": [ { "id": 1028, "state": "closed", "name": "2018 Sprint 09 SDK", "startDate": "2018-04-22T22:53:08.928Z", "endDate": "2018-05-06T22:53:00.000Z", "completeDate": "2018-05-07T00:02:15.883Z", "originBoardId": 114 }, { "id": 1018, "state": "closed", "name": "2018 Sprint 07 SDK", "startDate": "2018-03-25T21:59:36.637Z", "endDate": "2018-04-08T21:59:00.000Z", "completeDate": "2018-04-08T17:55:14.467Z", "originBoardId": 114 }, { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 }, { "id": 1008, "state": "closed", "name": "2018 Sprint 06 SDK", "startDate": "2018-03-11T22:18:04.396Z", "endDate": "2018-03-25T22:18:00.000Z", "completeDate": "2018-03-25T21:52:36.683Z", "originBoardId": 216 } ], "comment": { "comments": [ { "id": "434404", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9817", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-02-13T10:19:51.000+0000", "updated": "2018-02-13T10:19:51.000+0000" }, { "id": "437304", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR done by [~smohammed], PR merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-02T18:19:24.000+0000", "updated": "2018-05-02T18:19:24.000+0000" }, { "id": "438280", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket. Fix can be seen in SDK Version: 7.3.0.v20180607210411\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/9817", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-11T14:13:44.000+0000", "updated": "2018-06-11T14:13:44.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }