{ "id": "86355", "key": "TIMOB-7623", "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": "12097", "description": "", "name": "Sprint 2012-05", "archived": true, "released": true, "releaseDate": "2012-03-11" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-06T02:44:06.000+0000", "created": "2012-02-10T17:16:39.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_media", "parity", "qe-testadded", "release-note" ], "versions": [ { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-09T11:54:11.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": "The method is invoked like this:\r\n\r\nmyMovie.requestThumbnailImagesAtTimes(times, option, callback)\r\n\r\nThis method is supposed to provide a series of thumbnails. For each time offset in the \"times\" array, it's supposed to generate a thumbnail and invoke the callback. Looking at the code, it looks like the callback is being discarded after the first use.\r\n\r\nTest case: the following code should retrieve multiple thumbnails, and display them in the scrollview at the bottom. But in practice, only the first thumbnail is retrieved.\r\n\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create base UI tab and root window\r\n//\r\nvar vidWin = Titanium.UI.createWindow({\r\n\ttitle : 'Tab 1',\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nvar activeMovie = Titanium.Media.createVideoPlayer({\r\n\ttop : 0,\r\n\tbackgroundColor: 'red',\r\n\theight : 300,\r\n\twidth : 300,\r\n\tborderRadius : 20,\r\n\tborderWidth : 2,\r\n\tborderColor : 'blue',\r\n\tmediaControlStyle : Titanium.Media.VIDEO_CONTROL_EMBEDDED,\r\n\tscalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL\r\n});\r\n\r\n\r\n\r\n\r\nif(Ti.Platform.name == 'iPhone OS') {\r\n\tactiveMovie.addEventListener('durationAvailable', function(evt) {\r\n\t\tTi.API.info(\"Requesting thumbnails now.\");\r\n\t\tvar duration = activeMovie.duration/1000.0;\r\n\t\tactiveMovie.requestThumbnailImagesAtTimes([0, duration / 2, duration], Titanium.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME, function(response) {\r\n\t\t\tTi.API.info(\"Thumbnail callback called, success = \" + response.success);\r\n\t\t\tif(response.success) {\r\n\t\t\t\tvar ratio = scrollView.size.height / response.image.height;\r\n\t\t\t\tvar imgView = Titanium.UI.createImageView({\r\n\t\t\t\t\twidth : (response.image.width * ratio),\r\n\t\t\t\t\theight : (response.image.height * ratio),\r\n\t\t\t\t\timage : response.image\r\n\t\t\t\t});\r\n\t\t\t\tscrollView.add(imgView);\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}\r\n//activeMovie.url = contentURL;\r\nactiveMovie.url = 'movie.mp4';\r\nvidWin.add(activeMovie);\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n\twidth : '100%',\r\n\theight : '30%',\r\n\tcontentWidth : 'auto',\r\n\tcontentHeight : 'auto',\r\n\tlayout : 'horizontal',\r\n\tscrollType : 'horizontal',\r\n\tbottom : 0,\r\n});\r\n\r\n//view.add(imgView);\r\nvidWin.add(scrollView);\r\nvidWin.open();\r\n{code}\r\n\r\n\t", "attachment": [], "flagged": false, "summary": "iOS: VideoPlayer.requestThumbnailImagesAtTimes only calls callback once.", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "183633", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Updating example to use correct duration", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-02-17T10:39:50.000+0000", "updated": "2012-02-17T10:39:50.000+0000" }, { "id": "184293", "author": { "name": "monsieurfil", "key": "monsieurfil", "displayName": "Philippe Elsass", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Additional bug: \r\n- the app crashes if the callback is omitted although the doc indicates the param is optional,\r\n- the VideoPlayer doesn't dispatch the 'thumbnail' event.\r\n\r\nNotes:\r\n- a breakpoint in the obj-c code at the beginning of 'handleThumbnailImageRequestFinishNotification' shows that all the frames are generated, but the callback is released upon first reception.\r\n", "updateAuthor": { "name": "monsieurfil", "key": "monsieurfil", "displayName": "Philippe Elsass", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-25T15:19:11.000+0000", "updated": "2012-02-25T15:19:11.000+0000" }, { "id": "184312", "author": { "name": "monsieurfil", "key": "monsieurfil", "displayName": "Philippe Elsass", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here's a patch, but changing the API slightly: all the thumbnails are returned as one event.\r\n\r\nhttps://gist.github.com/1917875", "updateAuthor": { "name": "monsieurfil", "key": "monsieurfil", "displayName": "Philippe Elsass", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-26T09:41:32.000+0000", "updated": "2012-02-26T09:41:46.000+0000" }, { "id": "184641", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending #1537.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-02-29T10:21:06.000+0000", "updated": "2012-02-29T10:21:06.000+0000" }, { "id": "184726", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To test circular retain leakage, use the following:\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create base UI tab and root window\r\n//\r\nfunction newWindow(){\r\nvar vidWin = Titanium.UI.createWindow({\r\n\ttitle : 'Tab 1',\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nvar activeMovie = Titanium.Media.createVideoPlayer({\r\n\ttop : 0,\r\n\tbackgroundColor: 'red',\r\n\theight : 300,\r\n\twidth : 300,\r\n\tborderRadius : 20,\r\n\tborderWidth : 2,\r\n\tborderColor : 'blue',\r\n\tmediaControlStyle : Titanium.Media.VIDEO_CONTROL_EMBEDDED,\r\n\tscalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL\r\n});\r\n\r\nif(Ti.Platform.name == 'iPhone OS') {\r\n\tactiveMovie.addEventListener('durationAvailable', function(evt) {\r\n\t\tTi.API.info(\"Requesting thumbnails now.\");\r\n\t\tvar duration = activeMovie.duration/1000.0;\r\n\r\n\t\tactiveMovie.requestThumbnailImagesAtTimes([0, duration / 2, duration], Titanium.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME, function(response) {\r\n\t\t\tTi.API.info(\"Thumbnail callback called, success = \" + response.success);\r\n\t\t\tif(response.success) {\r\n\t\t\t\tvar ratio = scrollView.size.height / response.image.height;\r\n\t\t\t\tvar imgView = Titanium.UI.createImageView({\r\n\t\t\t\t\twidth : (response.image.width * ratio),\r\n\t\t\t\t\theight : (response.image.height * ratio),\r\n\t\t\t\t\timage : response.image\r\n\t\t\t\t});\r\n\t\t\t\tscrollView.add(imgView);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t});\r\n}\r\n//activeMovie.url = contentURL;\r\nactiveMovie.url = 'movie.mp4';\r\nvidWin.add(activeMovie);\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n\twidth : '100%',\r\n\theight : '30%',\r\n\tcontentWidth : 'auto',\r\n\tcontentHeight : 'auto',\r\n\tlayout : 'horizontal',\r\n\tscrollType : 'horizontal',\r\n\tbottom : 0,\r\n});\r\n\r\nvar closebtn = Ti.UI.createButton({bottom:50,width:200,height:50,title:'DONE'});\r\nclosebtn.addEventListener('click',function(){vidWin.close()});\r\n//view.add(imgView);\r\nvidWin.add(scrollView);\r\nvidWin.add(closebtn);\r\nvidWin.open();\r\n}\r\n\r\nvar win=Ti.UI.createWindow();\r\nvar openButton = Ti.UI.createButton({width:200,height:50,title:'open'});\r\nopenButton.addEventListener('click',newWindow);\r\nwin.add(openButton);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-29T16:09:07.000+0000", "updated": "2012-02-29T16:09:07.000+0000" }, { "id": "184901", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull request #1537 approved.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-02T11:48:45.000+0000", "updated": "2012-03-02T11:48:45.000+0000" }, { "id": "186732", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 2.0.0.v20120315170247\r\nTitanium Studio, build: 2.0.0.201203142055\r\nxcode: 4.2\r\nDevice: iphone 4s (5.0.1)\r\n", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-15T16:33:11.000+0000", "updated": "2012-03-15T16:33:11.000+0000" }, { "id": "201767", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update labels", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-06T02:43:23.000+0000", "updated": "2012-07-06T02:43:23.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }