How to stream audio using jquerymobile

How to stream audio using jquerymobile

Ok so here's the deal. I'm trying to develop a simple application to stream audio for a radio station.

I'm using phonegap together with the jquerymobile framework to create applications for the iPhone and Android.

Here's my html body code:

  1. <div data-role="page">
  2. <div id="radioContent">
  3. <div data-role="content">
  4. <a data-role="button" onclick="RadioListenLive()">
  5.                               <div id="radiotext">Listen Live</div>
  6.                         </a>
  7. </div>
  8. </div>
  9. </div>

and here's my .js code:

  1. var radioStream = new Audio('http://yp.shoutcast.com/sbin/tunein-station.pls?id=496891');
  2. var radioPlaying = false;

  3. function RadioListenLive() 
  4. {
  5. try 
  6. {
  7. if (radioPlaying)
  8. {
  9. radioStream.pause();
  10. document.getElementById("radiotext").innerHTML = "Listen Live";
  11. radioPlaying = false;
  12. }
  13. else
  14. {
  15. radioStream.play();
  16. document.getElementById("radiotext").innerHTML = "Click to pause";
  17. radioPlaying = true;
  18. }
  19. }
  20. catch (e) 
  21. {
  22. alert(e.message);
  23. }
  24. }

This works for the iPhone, but not for Android. Is this the correct way to do this? It seems a little bit too.....simple. and I'm confused. I mean, is a valid link all it takes to stream audio??.. I was thinking I would need audio player plugins and such to get it going.

The audio streaming link in this example was found from  http://www.shoutcast.com/ which basically plays a .pls file. Please, any help is appreciated.