Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-1219

Calling pause() on a paused AudioPlayer causes it to play

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Invalid
    • Affects Version/s: None
    • Component/s: Titanium SDK & CLI
    • Labels:
    • Environment:

      iOS with 3.5.0GA

      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.

      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();
      

        Attachments

          Activity

            People

            • Assignee:
              sliang Shuo Liang
              Reporter:
              kiafaldorius Kia Kroas
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration