{ "id": "84024", "key": "TIMOB-6742", "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": "12090", "description": "", "name": "Sprint 2011-50", "archived": true, "released": true, "releaseDate": "2011-12-19" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2011-12-17T17:51:58.000+0000", "created": "2011-12-17T15:59:49.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "14279", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "84025", "key": "TIDOC-178", "fields": { "summary": "APIDoc: Titanium.Media.VideoPlayer requires updates regarding platform-specific events and property availability", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T23:17:20.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": "Apparently the video duration is not available on device, even after the video begins playing or goes through a thumbnail grab (it may not be available beforehand, due to Apple bugs or other issues).\r\n\r\n{code}\r\nvar win = Titanium.UI.currentWindow;\r\nwin.backgroundColor = '#FFFFFF'\r\n\r\nvar close_button = Titanium.UI.createButton({\r\n title:'Close'\r\n});\r\n\r\nwin.leftNavButton = close_button;\r\n\r\nclose_button.addEventListener('click', function(e) {\r\n win.close();\r\n});\r\n\r\nvar activeMovie = Titanium.Media.createVideoPlayer(\r\n{\r\n url : 'http://c0222252.cdn.cloudfiles.rackspacecloud.com/0032_MotoBlur.m4v',\r\n mediaControlStyle:Titanium.Media.VIDEO_CONTROL_DEFAULT,\r\n scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FIT,\r\n autoplay : false\r\n});\r\n\r\nactiveMovie.addEventListener('complete',function()\r\n{\r\n Ti.API.info (\"[test_duration.js] Movie completed\");\r\n Ti.API.info (\"[test_duration.js] duration after playing: \" + activeMovie.duration);\r\n});\r\n\r\n\r\n//win.add(activeMovie);\r\n\r\n\r\nvar selected_video_thumbnail = activeMovie.thumbnailImageAtTime (5, Titanium.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME);\r\nTi.API.info (\"[test_duration.js] duration after getting thumbnail: \" + activeMovie.duration);\r\n{code}\r\n\r\nSupport ticket: http://support.appcelerator.com/tickets/APP-792614/tickets\r\n\r\nShould make a drillbit or KS test available.", "attachment": [], "flagged": false, "summary": "iOS: Video duration not available on device", "creator": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "176424", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Duration cannot be retrieved until the \"durationAvailable\" event is triggered. Looking into the best way to manually trigger that event now, because there is no guarantee that the duration is valid until that event is received.\r\n\r\nFor large video stored remotely, this could take some time, especially on radio connections.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-17T17:48:29.000+0000", "updated": "2011-12-17T17:49:22.000+0000" }, { "id": "176425", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested iPod 4GT / iOS 5.0.1 over WiFi (no WWAN support). Here are the findings:\r\n\r\nVideo does not necessarily have all of its metadata loaded immediately after a request, especially for large remote files. You cannot get the duration until a video specifically says that the duration is available via the \"durationAvailable\" event. This property is documented, and so this bug is being marked \"WON'T FIX\" instead of being handled to docs (although the documentation could probably be better).\r\n\r\nSample code which displays the MOST CORRECT behavior:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nwin.backgroundColor = '#FFFFFF'\r\n\r\nvar close_button = Titanium.UI.createButton({\r\n title:'Close'\r\n});\r\n\r\nwin.leftNavButton = close_button;\r\n\r\nclose_button.addEventListener('click', function(e) {\r\n win.close();\r\n});\r\n\r\nvar activeMovie = Titanium.Media.createVideoPlayer(\r\n{\r\n url : 'http://c0222252.cdn.cloudfiles.rackspacecloud.com/0032_MotoBlur.m4v',\r\n mediaControlStyle:Titanium.Media.VIDEO_CONTROL_DEFAULT,\r\n scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FIT,\r\n autoplay : false\r\n});\r\n\r\nactiveMovie.addEventListener('complete',function()\r\n{\r\n Ti.API.info (\"[test_duration.js] Movie completed\");\r\n Ti.API.info (\"[test_duration.js] duration after playing: \" + activeMovie.duration);\r\n});\r\n\r\n\r\n//win.add(activeMovie);\r\n\r\nactiveMovie.addEventListener(\"durationAvailable\", function() {\r\n\tTi.API.info (\"[test_duration.js] duration after getting thumbnail: \" + activeMovie.duration);\r\n});\r\n\r\nvar selected_video_thumbnail = activeMovie.thumbnailImageAtTime (5, Titanium.Media.VIDEO_TIME_OPTION_NEAREST_KEYFRAME);\r\n{code}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-17T17:51:58.000+0000", "updated": "2011-12-17T17:51:58.000+0000" }, { "id": "176426", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Filed a doc bug (TIMOB-6743) indicating that there may be a lack of useful information available about when certain metadata values are valid.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-17T18:10:26.000+0000", "updated": "2011-12-17T18:10:39.000+0000" }, { "id": "177169", "author": { "name": "davidgeller", "key": "davidgeller", "displayName": "David Geller", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The 'durationAvailable' event never seems to appear for Android in 1.8.0.1.", "updateAuthor": { "name": "davidgeller", "key": "davidgeller", "displayName": "David Geller", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-25T18:33:28.000+0000", "updated": "2011-12-25T18:33:28.000+0000" }, { "id": "409040", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T23:17:20.000+0000", "updated": "2017-03-03T23:17:20.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }