Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19519

iOS - Ti.Media.AudioPlayer - error after sleep/wake

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Environment:

      SDK 4.1.0. iOS 8.

    • Story Points:
      0
    • Sprint:
      2018 Sprint 01 SDK

      Description

      I use Ti.Media.AudioPlayer to play remote mp3s. If I pause the player, lock the screen, wait for ~30 seconds, wake it up and resume the playback, the audio plays for a few seconds and then stops. This is a big issue.

      To reproduce:

      1. Create a default alloy project.
      2.Replace index.js with the following code:
      ~~~
      Ti.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAYBACK;
      function doClick(e)

      { audioplayer.pause(); }

      var audioplayer = Ti.Media.createAudioPlayer(

      {url:'http://www.stephaniequinn.com/Music/Vivaldi%20-%20Spring%20from%20Four%20Seasons.mp3'}

      );
      audioplayer.play();
      $.index.open();
      ~~~
      3. add the following to tiapp.xml (ios->plist->dict)
      ~~~
      <key>UIBackgroundModes</key>
      <array>
      <string>audio</string>
      </array>
      ~~~
      4. Launch the app. Wait for the music to play.
      5. Pause the music by clicking "Hello, World."
      6. Go to Home (optional)
      7. Lock the device. Wait for ~30 seconds.
      8. Unlock the device. Open the app. Resume the music by clicking "Hello, World."
      9. The audio plays for a few seconds and then stop. Error: No audio data found.
      10. Sometimes the error doesn't show up (rarely). Repeat from 5 - 9 until the error shows.

      This test is run on an iPad 4. iOS 8. SDK 4.1.0.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                shawnlan Shawn Lan
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20351
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code