{ "id": "94225", "key": "TIMOB-9852", "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-07-23T21:06:20.000+0000", "created": "2012-07-02T04:14:02.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api" ], "versions": [ { "id": "13273", "description": "Release 2.0.2", "name": "Release 2.0.2", "archived": false, "released": true, "releaseDate": "2012-05-31" } ], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-14T05:22:59.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "h2. Feature description\r\nWhen the playback of an audio file with Ti.Media.AudioPlayer object terminates, the object should fire a 'complete' event, similarly to what Ti.Media.Sound does.", "attachment": [], "flagged": false, "summary": "iOS: Titanium.Media.AudioPlayer should fire a 'complete' event, when the audio play is over", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Product: Mobile\r\nTitanium SDK: Mobile 2.0.2\r\nPlatform OS: iOS\r\nPlatform OS Version: 4.x, 5.x", "comment": { "comments": [ { "id": "202458", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Couldn't this be accomplished by just listening for the change event and checking e.state = Ti.Media.AudioPlayer.STATE_STOPPED ?", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-07-10T16:24:21.000+0000", "updated": "2012-07-10T16:24:21.000+0000" }, { "id": "208524", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Stopped fires whenever the player stops playing, which is likely due to user action or server error, but also when the stream ends. AudioPlayer is often meant for streams that have no end, thus a lack of explicit complete event.\r\n\r\nTo avoid confusing the stream ending than the user manually stopping, try something like this:\r\n{code}\r\nvar shouldBePlaying;\r\nstartButton.addEventListener('click',function(){\r\n shouldBePlaying=true;stream.start();\r\n});\r\nstartButton.addEventListener('click',function(){\r\n shouldBePlaying=false;stream.stop();\r\n});\r\nstream.addEventListener('change',function(e){\r\n if(e.description=='stopped'){\r\n if(shouldBePlaying){\r\n alert('Stream complete!');\r\n }\r\n shouldBePlaying=false;\r\n }\r\n});\r\n{code}\r\n", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-19T15:06:35.000+0000", "updated": "2012-07-19T15:06:35.000+0000" }, { "id": "208962", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Streams are not meant for completion, typically, and worse yet there's little to tell the difference between a finished stream and the server cutting out, in which case 'complete' would be a misnomer.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-23T14:55:52.000+0000", "updated": "2012-07-23T14:55:52.000+0000" }, { "id": "411976", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-14T05:22:59.000+0000", "updated": "2017-03-14T05:22:59.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }