Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1803] Android 4.1: Can not play audio stream

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-20T14:58:04.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, audioPlayerAPIs
ReporterJoe Falcone
AssigneeShak Hossain
Created2013-03-19T19:37:02.000+0000
Updated2016-03-08T07:40:42.000+0000

Description

Nothing fancy - just passing an URL to createAudioPlayer - this has worked on all of our devices from Android 2.2 thru Android 3 to Android 4.0x. On Android 4.1+ the player (apparently) times out after trying to connect for something like a minute. These URLs also fail when used with the built-in MP3 and Audio players on Android 4.1+ The URLs we're using are from Live365 - http://www.live365.com/play/372628 http://www.live365.com/play/372475 sound = Ti.Media.createAudioPlayer({ url : url, allowBackground : true });

Comments

  1. Carter Lathrop 2013-03-19

    Joe, would you mind providing a simple test case that shows this behavior? Just something that is able to be copied and pasted into an app.js and shows the bug. Once I can reproduce and confirm, I will move to engineering for them to look at. Thank you, Carter
  2. Davide Cassenti 2013-03-20

    Hello, Tested on Nexus 4, with Android 4.2.2:
       var url = 'http://www.live365.com/play/372628';
       
       var sound = Ti.Media.createAudioPlayer({ url : url, allowBackground : true });
       sound.start();
       
    I can hear the sound just fine. Let me know if your code is any different.
  3. Joe Falcone 2013-04-12

    There was a difference - I had a preload : true property which I commented out - otherwise my code is the same as in Cassenti's post. And when I tried to run, it did the same thing as before - spun the activity indicator for about 30 seconds and then completely blew up... This is on Android 4.1.1 on a Samsung Galaxy Tab connected via WiFi {noformat} 04-12 01:35:22.656: W/TiSound(3068): (KrollRuntimeThread) [48631,69475] Issue while initializing : 04-12 01:35:22.656: W/TiSound(3068): java.io.IOException: Prepare failed.: status=0x1 04-12 01:35:22.656: W/TiSound(3068): at android.media.MediaPlayer.prepare(Native Method) 04-12 01:35:22.656: W/TiSound(3068): at ti.modules.titanium.media.TiSound.initialize(TiSound.java:124) 04-12 01:35:22.656: W/TiSound(3068): at ti.modules.titanium.media.TiSound.play(TiSound.java:181) 04-12 01:35:22.656: W/TiSound(3068): at ti.modules.titanium.media.AudioPlayerProxy.play(AudioPlayerProxy.java:124) 04-12 01:35:22.656: W/TiSound(3068): at ti.modules.titanium.media.AudioPlayerProxy.start(AudioPlayerProxy.java:117) 04-12 01:35:22.656: W/TiSound(3068): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) 04-12 01:35:22.656: W/TiSound(3068): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:58) 04-12 01:35:22.656: W/TiSound(3068): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:694) 04-12 01:35:22.656: W/TiSound(3068): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:918) 04-12 01:35:22.656: W/TiSound(3068): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:310) 04-12 01:35:22.656: W/TiSound(3068): at ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:861) 04-12 01:35:22.656: W/TiSound(3068): at android.os.Handler.dispatchMessage(Handler.java:95) 04-12 01:35:22.656: W/TiSound(3068): at android.os.Looper.loop(Looper.java:137) 04-12 01:35:22.656: W/TiSound(3068): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) {noformat}
  4. Joe Falcone 2013-04-12

  5. Mostafizur Rahman 2014-01-20

    Hello, I tested this issue with the tested code below. I can’t reproduce this issue in latest Ti SDK and android. It’s working fine as we expected. Please check this code in latest Ti SDK and let us know if you have any problem persist.

    Test Environment

    Mac OS X 10.8.5 Ti SDK 3.2.0.GA Ti CLI 3.2.0 Android Device 2.3.3 and 4.2.2

    Test Code

       var win = Ti.UI.createWindow({
           backgroundColor : 'pink',
       });
        
       var url = 'http://www.live365.com/play/372628';
        
       var sound = Ti.Media.createAudioPlayer({ url : url, allowBackground : true ,preload : true });
       sound.start();
       win.open();
       

    Step for Test

    Create a simple test project

    Update app.js file to test code

    Run on android device

    Audio will play automatically

    Actual Result:

    Audio will play with sound

    Expected result:

    Audio will play with sound Thanks
  6. Shak Hossain 2014-01-20

    Closing since the issue is not reproducible with 3.2GA.

JSON Source