{ "id": "170689", "key": "TIMOB-25638", "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-01-10T14:44:30.000+0000", "created": "2017-12-28T16:03:50.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "video" ], "versions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-01-10T14:45:18.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "I'm trying to get video thumbnail using the below snippet code, but requestThumbnailImagesAtTimes doesn't call the callback at all on iOS, while it works on android.\r\n\r\nrequestThumbnailImagesAtTimes, is used on a local video, I tried bot to set the URL, or media but doesn't seem to work.\r\n\r\n\r\n{code:javascript}\r\n\r\nfunction openIOSVideoGallery() {\r\n Titanium.Media.openPhotoGallery({\r\n success: function (e) {\r\n if (e.success && e.mediaType == Titanium.Media.MEDIA_TYPE_VIDEO)\r\n getVideoThumbnail(e.media).then(function (success) {\r\n //On Thumbnail Success\r\n }).catch(function (error) {\r\n //On Thumbnail Error\r\n });\r\n },\r\n cancel: function (e) {\r\n console.log(e);\r\n },\r\n error: function (e) {\r\n console.log(e);\r\n },\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO]\r\n });\r\n}\r\n\r\nfunction getVideoThumbnail(video) {\r\n return new Promise(function (resolve, reject) {\r\n Titanium.Media.createVideoPlayer({\r\n height: dpToPixel(100),\r\n url: video.nativePath,\r\n scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FILL,\r\n width: dpToPixel(100)\r\n }).requestThumbnailImagesAtTimes([0], Titanium.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME, function (e) {\r\n if (e.success) {\r\n resolve({\r\n thumbnail: e.image,\r\n media: video\r\n });\r\n } else {\r\n reject({\r\n error: e.error,\r\n media: video\r\n });\r\n }\r\n });\r\n });\r\n}\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: Callback of requestThumbnailImagesAtTimes is not fired", "creator": { "name": "malhajj", "key": "malhajj", "displayName": "Mohamad Alhajj ", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "malhajj", "key": "malhajj", "displayName": "Mohamad Alhajj ", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Node.js\r\n ✓ node installed (v5.2.0)\r\n ✓ npm installed (v3.3.12)\r\n\r\nTitanium CLI\r\n ✓ cli bleeding edge (v5.0.14)\r\n\r\nTitanium CLI Dependencies\r\n ✓ adm-zip up-to-date (v0.4.7)\r\n ✓ async up-to-date (v2.1.2)\r\n ✓ colors up-to-date (v1.1.2)\r\n ✓ fields up-to-date (v0.1.24)\r\n ✓ fs-extra up-to-date (v2.1.2)\r\n ✓ humanize up-to-date (v0.0.9)\r\n ✓ longjohn up-to-date (v0.2.11)\r\n ✓ moment up-to-date (v2.16.0)\r\n ✓ node-appc up-to-date (v0.2.41)\r\n ✓ request up-to-date (v2.79.0)\r\n ✓ semver up-to-date (v5.3.0)\r\n ✓ sprintf up-to-date (v0.1.5)\r\n ✓ temp up-to-date (v0.8.3)\r\n ✓ winston up-to-date (v1.1.2)\r\n\r\nTitanium SDK\r\n ✓ latest sdk installed (v6.3.0.GA)\r\n ✓ selected sdk up-to-date (v6.3.0.GA)\r\n\r\nMac OS X Environment\r\n ✓ CLI Tools installed\r\n\r\niOS Environment\r\n ✓ Xcode installed (7.1.1, 8.3.2, 9.0)\r\n ✓ iOS SDK installed (10.3, 11.0, 9.1)\r\n ✓ WWDR cert installed\r\n ✓ developer cert installed (1 found)\r\n ✓ distribution cert installed (2 found)\r\n ✓ dev provisioning installed (8 found)\r\n ✓ dist provisioning installed (15 found)\r\n\r\nAndroid Environment\r\n ✓ sdk installed (/Users/Apple/Library/Android/sdk)\r\n ✓ tools installed (v26.1.1)\r\n ✓ platform tools installed (v26.0.1)\r\n ✓ build tools installed (v26.0.0)\r\n ✓ adb installed /Users/Apple/Library/Android/sdk/platform-tools/adb\r\n ✕ android \"android\" executable not found; please reinstall Android SDK\r\n ✓ emulator installed /Users/Apple/Library/Android/sdk/tools/emulator\r\n ✓ mksdcard installed /Users/Apple/Library/Android/sdk/tools/mksdcard\r\n ✓ zipalign installed /Users/Apple/Library/Android/sdk/build-tools/26.0.0/zipalign\r\n ✓ aapt installed /Users/Apple/Library/Android/sdk/build-tools/26.0.0/aapt\r\n ✓ aidl installed /Users/Apple/Library/Android/sdk/build-tools/26.0.0/aidl\r\n ✓ targets installed (13 found)\r\n ! avds no avds found\r\n ✓ ndk installed (11.2.2725575)\r\n ✓ ndk-build installed (/Users/Apple/Library/Android/ndk/ndk-build)\r\n\r\nJava Development Kit\r\n ✓ jdk installed (v1.8.0)\r\n ✓ java installed /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java\r\n ✓ javac installed /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/javac\r\n ✓ keytool installed /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/keytool\r\n ✓ jarsigner installed /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/jarsigner\r\n\r\nIntel® Hardware Accelerated Execution Manager (HAXM)\r\n ✓ compatible\r\n ✓ installed\r\n\r\nNetwork\r\n ✓ online\r\n - no proxy server configured\r\n ✓ Network connection test\r\n ✓ Java-based connection test\r\n\r\nDirectory Permissions\r\n ✓ home directory\r\n ✓ titanium config directory\r\n ✓ titanium sdk install directory\r\n ✓ workspace directory\r\n ✓ temp directory", "closedSprints": [ { "id": 985, "state": "closed", "name": "2018 Sprint 01 SDK", "startDate": "2017-12-31T16:58:54.631Z", "endDate": "2018-01-14T16:58:00.000Z", "completeDate": "2018-01-17T22:44:27.028Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "432599", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~malhajj] I think your attached test-case belongs to a different ticket? I moved it to TIMOB for further investigation.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-12-30T10:45:16.000+0000", "updated": "2017-12-30T10:45:16.000+0000" }, { "id": "432600", "author": { "name": "malhajj", "key": "malhajj", "displayName": "Mohamad Alhajj ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Hans,\nYes your right you can remove the attached test case, since it belongs to another ticket.\nThanks, \n\nSent from JIRA Mobile", "updateAuthor": { "name": "malhajj", "key": "malhajj", "displayName": "Mohamad Alhajj ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-30T10:55:42.000+0000", "updated": "2017-12-30T10:55:42.000+0000" }, { "id": "432609", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Example test-case:\r\n{code:js}\r\n/**\r\n * This file is used to validate iOS test-cases. It is ran using the Xcode\r\n * project in titanium_mobile/iphone/iphone/Titanium.xcodeproj.\r\n *\r\n * Change the below code to fit your use-case. By default, it included a button\r\n * to trigger a log that is displayed in the Xcode console.\r\n */\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Select Video + Generate Thumbnail'\r\n});\r\n\r\nbtn.addEventListener('click', selectVideo);\r\n\r\nwin.add(btn);\r\nwin.open();\r\n\r\nfunction selectVideo() {\r\n Titanium.Media.openPhotoGallery({\r\n success: function(e) {\r\n if (e.mediaType == Titanium.Media.MEDIA_TYPE_VIDEO) {\r\n getVideoThumbnail(e.media, function(_e) {\r\n if (e.error) {\r\n alert('Error: ' + e.error);\r\n } else {\r\n win.add(Ti.UI.createImageView({\r\n image: e.thumbnail\r\n }));\r\n }\r\n });\r\n }\r\n },\r\n cancel: function(e) {\r\n console.log(e);\r\n },\r\n error: function(e) {\r\n console.log(e);\r\n },\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO]\r\n });\r\n}\r\n\r\nfunction getVideoThumbnail(video, cb) {\r\n var player = Titanium.Media.createVideoPlayer({\r\n height: 100,\r\n url: video.nativePath,\r\n scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FILL,\r\n width: 100\r\n })\r\n\r\n player.requestThumbnailImagesAtTimes([0], Titanium.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME, function(e) {\r\n if (e.success) {\r\n cb({\r\n thumbnail: e.image,\r\n media: video\r\n });\r\n } else {\r\n cb({\r\n error: e.error,\r\n media: video\r\n });\r\n }\r\n });\r\n}\r\n{code}\r\n\r\nWeirdly, it calls the callback as expected but then errors when trying to set an image to display the result. Probably [~vijaysingh] will know some more insights here!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-01T21:09:14.000+0000", "updated": "2018-01-01T21:09:14.000+0000" }, { "id": "432610", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] [~malhajj] The test case, which [~hknoechel] has attached, has a typo inside selectVideo() function. Rather e.thumbnail it should be _e.thumbnail. Please find the updated section inside selectVideo() function -\r\n\r\n\r\n{code:java}\r\ngetVideoThumbnail(e.media, function(_e) {\r\n if (_e.error) {\r\n alert('Error: ' + _e.error);\r\n } else {\r\n win.add(Ti.UI.createImageView({\r\n image: _e.thumbnail\r\n }));\r\n }\r\n });\r\n{code}\r\n\r\nNow it will work fine. Let me know if you are facing any other issue. Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-02T04:49:12.000+0000", "updated": "2018-01-02T04:50:18.000+0000" }, { "id": "432612", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ohhh, of course, you are right! Holiday is still in my head. [~malhajj] Let us know your feedback! ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-02T06:33:40.000+0000", "updated": "2018-01-02T06:33:40.000+0000" }, { "id": "432675", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~vijaysingh] May this be a kroll-thread issue? [~malhajj] Please give us some feedback, thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-03T10:33:34.000+0000", "updated": "2018-01-03T10:33:34.000+0000" }, { "id": "432715", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] I have verified on kroll-thread also. Its working fine. Let's wait for [~malhajj]'s feedback.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-04T03:40:26.000+0000", "updated": "2018-01-04T03:40:26.000+0000" }, { "id": "432956", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~malhajj] One more ping. We are not able to reproduce it and all test-cases pass. Please let us know by end of the day or we need to resolve it as {{Cannot Reproduce}} for now.\r\n\r\n*EDIT*: Resolving as {{Cannot Reproduce}} due to our test results and no activity.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-10T08:13:53.000+0000", "updated": "2018-01-10T14:45:08.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }