[TIMOB-9852] iOS: Titanium.Media.AudioPlayer should fire a 'complete' event, when the audio play is over
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-07-23T21:06:20.000+0000 |
Affected Version/s | Release 2.0.2 |
Fix Version/s | n/a |
Components | TiAPI |
Labels | api |
Reporter | Davide Cassenti |
Assignee | Neeraj Gupta |
Created | 2012-07-02T04:14:02.000+0000 |
Updated | 2017-03-14T05:22:59.000+0000 |
Description
Feature description
When 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.
Comments
JSON Source
Couldn't this be accomplished by just listening for the change event and checking e.state = Ti.Media.AudioPlayer.STATE_STOPPED ?
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. To avoid confusing the stream ending than the user manually stopping, try something like this:
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.
Closing ticket as invalid.