0

I'm new in the mobile app development and I'm trying to do a simple online radio app using flash builder 4.5, but every time I try to play audio from a remote site (stream) it just not work. I've done different test, and when I use a local audio files everything works flawlessly. Below is the code that I'm using right now, if someone can give me a hint of what could be happening I will really appreciate it.

**

        private var req:URLRequest;
        private var context:SoundLoaderContext = new SoundLoaderContext(8000, true);
        private var s:Sound;
        private var channel:SoundChannel = new SoundChannel();

                    private function AudioOn():void
        {
            req = new URLRequest("http://208.76.152.74:8000");
            s = new Sound(req,context);
            channel=s.play();


        }
    ]]>
</fx:Script>


<fx:Declarations>

    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Button x="200" y="246" label="Play" icon="@Embed('file:///Users/Manu/Downloads/home.png')" click="AudioOn()"/>**

2 Answers2

1

I was looking for how to do this and with combining problems i got i working with your code, you have only to put ;Stream.mp3 next to the stream like this!

req = new URLRequest("http://208.76.152.74:8000;Stream.mp3");

Bas
  • 11
  • 1
0

Is the internet permission enabled in your application descriptor file?

See this AIR Article...

citizen conn
  • 15,300
  • 3
  • 58
  • 80