{ "id": "120492", "key": "TIMOB-15618", "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": null, "resolutiondate": null, "created": "2013-09-26T20:27:20.000+0000", "priority": null, "labels": [ "complete", "events", "reprod", "url", "video", "videoplayer" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:19.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "After changing the Titanium.Media.VideoPlayer.url value the videoPlayer fires a onComplete event that should not be fired, or at least fired including the real reason for it, but currently the event.reason is 0 (Ti.Media.VIDEO_FINISH_REASON_PLAYBACK_ENDED).\r\n\r\nThis is causing a lot of trouble to create a playlist app.\r\nWe could have a VIDEO_FINISH_REASON_SOURCE_CHANGED as a new reason, would be way better\r\n\r\nThis is a very old topic: [http://developer.appcelerator.com/question/121674/complete-event-firing-when-changing-url-on-video-player]\r\n\r\n{code:javascript}\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff',\r\n \r\n});\r\n\r\nvar videoPlayer = Ti.Media.createVideoPlayer({\r\n\tbackgroundColor:'#fff',\t\r\n\tautoplay:true,\r\n\turl:'firstSong.mp3'\r\n})\r\n\r\nvideoPlayer.addEventListener('complete',function(e){\r\n\tTi.API.info('========')\r\n\tTi.API.info('complete event fired - ' + JSON.stringify(e))\r\n\tTi.API.info('Event reason should not be 0 but it is ' + e.reason)\r\n\tTi.API.info('========')\t\r\n})\r\n\r\nvar nextSongBtn = Ti.UI.createButton({\r\n\ttop:100,\r\n\ttitle:'Click to change the music' \r\n})\r\nnextSongBtn.addEventListener('click',function(){\r\n\tvideoPlayer.url = 'mynewfile.mp3';\t\r\n})\r\n \r\n\r\nwin1.add(videoPlayer);\r\nwin1.add(nextSongBtn);\r\n\r\nwin1.open();\r\n\r\n//Current playback reasons, here we could have a VIDEO_FINISH_REASON_SOURCE_CHANGED as a new reason\r\nTi.API.info('Ti.Media.VIDEO_FINISH_REASON_PLAYBACK_ENDED = ' + Ti.Media.VIDEO_FINISH_REASON_PLAYBACK_ENDED)\r\nTi.API.info('Ti.Media.VIDEO_FINISH_REASON_PLAYBACK_ERROR = ' + Ti.Media.VIDEO_FINISH_REASON_PLAYBACK_ERROR)\r\nTi.API.info('Ti.Media.VIDEO_FINISH_REASON_USER_EXITED = ' + Ti.Media.VIDEO_FINISH_REASON_USER_EXITED)\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Titanium.Media.VideoPlayer fires COMPLETE event when url changes", "creator": { "name": "cleison.ezoom", "key": "cleison.ezoom", "displayName": "Ezoom Agency", "active": true, "timeZone": "America/Sao_Paulo" }, "subtasks": [], "reporter": { "name": "cleison.ezoom", "key": "cleison.ezoom", "displayName": "Ezoom Agency", "active": true, "timeZone": "America/Sao_Paulo" }, "environment": "TI 3.1.3 Android/iOS", "comment": { "comments": [ { "id": "319435", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces on both SDK version 3.1.3 and 3.4.0 (Unreleased)\r\n\r\nTitanium Command-Line Interface, \r\nCLI version 3.3.0, \r\nTitanium SDK version 3.4.0.GA \r\nTitanium SDK version 3.1.3 GA\r\n\r\niOS SDK: 7.1 \r\niOS iPhone: 7.1", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-20T09:00:13.000+0000", "updated": "2014-08-20T09:00:13.000+0000" }, { "id": "422580", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\niPhone 7 (10.2)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170620103414\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-22T21:48:17.000+0000", "updated": "2017-06-22T21:48:17.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }