[AC-1219] Calling pause() on a paused AudioPlayer causes it to play
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2015-03-06T10:31:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | AudioPlayer |
Reporter | Kia Kroas |
Assignee | Shuo Liang |
Created | 2015-03-03T21:51:25.000+0000 |
Updated | 2016-03-08T07:37:36.000+0000 |
Description
If I play an AudioPlayer and then pause, it'll correctly pause the media. However, calling pause() a second time on the already paused media will cause it to start playing again.
Click play, it'll play. Then pause, it'll pause. Then pause again. It'll start playing again. It does this with any mp3 file on iOS. Have not checked behavior on Android.
{noformat}
var win = Ti.UI.createWindow();
var play = Ti.UI.createLabel({text: 'PLAY', right: 0});
var pause = Ti.UI.createLabel({text: 'PAUSE', left: 0});
var audio = Ti.Media.createAudioPlayer({url: 'https://archive.org/download/WarnersSevenAcesJazzBand-TheresEverythingNiceAboutYou1927/WarnersSevenAcesJazzBand-TheresEverythingNiceAboutYou1927.mp3'});
play.addEventListener('click', function(){
audio.play();
});
pause.addEventListener('click', function(){
audio.pause();
});
win.add(play);
win.add(pause);
win.open();
{noformat}
This is normal behaviour, see doc: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.AudioPlayer-method-pause