{ "id": "65553", "key": "TIMOB-4135", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-03-26T11:09:37.000+0000", "created": "2011-05-18T14:34:38.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "CLA" ], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:21:10.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": "h1. Problem\r\n\"VIDEO_REPEAT_MORE_ONE\" (herewithin \"ONE\") repeats the video forever. The docs state, \"the video will repeat once\", so something is not quite right.\r\n\r\nh2. Solution\r\nAdd a third constant, \"VIDEO_REPEAT_MODE_INFINITE\", and bind that to the existing behavior of \"ONE\". Then fix \"ONE\" so that it will repeat just once.\r\n\r\nh2. Sample Code\r\nThe following code will repeat forever if the bug is present. Drop it in an app.js, and it will download the mp4 before it plays it.\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#000' });\r\nvar url = 'http://theatercrew.com/sample.mp4';\r\nvar file = Ti.Filesystem.getFile('file:///sdcard/').exists()\r\n ? Ti.Filesystem.getFile('file:///sdcard/sample.mp4')\r\n : Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'sample.mp4');\r\n\r\nfunction playVideo() {\r\n var video = Ti.Media.createVideoPlayer({\r\n url: file.nativePath,\r\n repeatMode: Ti.Media.VIDEO_REPEAT_MODE_ONE\r\n });\r\n if (parseFloat(Ti.Platform.version) >= 3.2) {\r\n win.add(video);\r\n }\r\n video.play();\r\n}\r\nfunction downloadVideo() {\r\n var progress = Ti.UI.createProgressBar({ max: 1, min: 0, value: 0, visible: true });\r\n win.add(progress);\r\n var client = Ti.Network.createHTTPClient({\r\n ondatastream: function(e) {\r\n progress.value = e.progress;\r\n },\r\n onload: function() {\r\n file.write(this.responseData);\r\n win.remove(progress);\r\n playVideo();\r\n }\r\n });\r\n client.open('GET', url);\r\n client.send();\r\n}\r\n\r\nif (file.exists()) {\r\n playVideo();\r\n}\r\nelse {\r\n downloadVideo();\r\n}\r\n\r\nwin.open();\r\n{code}\r\n\r\nh2. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-667723", "attachment": [], "flagged": false, "summary": "iOS: VIDEO_REPEAT_MODE_ONE repeats forever", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": "BROKEN on iPhone Simulator 4.3", "comment": { "comments": [ { "id": "158593", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a documentation bug, not a code bug. The documentation for the video SHOULD BE: \"constant for repeating one video setting\", akin to MUSIC_PLAYER_REPEAT_ONE. That is, the 'one' indicates number of items to repeat nonstop, not number of times to repeat it.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-05T16:58:23.000+0000", "updated": "2011-07-05T16:58:23.000+0000" }, { "id": "188617", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As of this posting, the documentation correctly notes:\r\n{quote}\r\nname: VIDEO_REPEAT_MODE_ONE\r\nsummary: Constant for repeating one video (i.e., the one video will repeat constantly) during playback.\r\n{quote}\r\n\r\nClosing this bug as invalid.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-26T11:09:20.000+0000", "updated": "2012-03-26T11:09:20.000+0000" }, { "id": "415667", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:21:10.000+0000", "updated": "2017-03-24T18:21:10.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }