How to use android media player play radio streaming in asx format -


i want play streaming url:

http://www.mediacorpradio.sg/radioliveplayer/asx/class95/fm950.asx 

what tried:

public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);             ...       // player     player = new mediaplayer();     player.setaudiostreamtype(audiomanager.stream_music);     player.setonpreparedlistener(new onpreparedlistener() {         public void onprepared(mediaplayer mp) {             mp.start();             button.setimageresource(r.drawable.pause);         }     });     try {         player.setdatasource(radio_url);     } catch (exception e) {         toast("unable play radio. please email if see constantly.");         return;     }      player.prepareasync();  }  private void togglestate(){     if (player.isplaying()) {         player.pause();         button.setimageresource(r.drawable.play);     }else{         player.prepareasync();     } }  @override public void ondestroy() {     super.ondestroy();     player.release(); } 

error get: (1, -1004)


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -