Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1219] Calling pause() on a paused AudioPlayer causes it to play

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2015-03-06T10:31:18.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsAudioPlayer
ReporterKia Kroas
AssigneeShuo Liang
Created2015-03-03T21:51:25.000+0000
Updated2016-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}

Comments

  1. Shuo Liang 2015-03-06

    This is normal behaviour, see doc: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.AudioPlayer-method-pause

JSON Source