android - Stream mp3 from link -


I am trying to create an app that can stream MP3 content from the web. When I run this code, I do not mind, but no audio is played, any help? Thanks

  Private Media Player Media Player; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.activity_main); InitView (); Try {MediaPlayer.setDataSource ("my link.mp3"); // mediaPlayer.prepareAsync (); //mediaPlayer.prepare (); // if (Mediaplayer.isplaying ()) {mediaPlayer.start (); }} Hold (exception e) {e.printStackTrace (); }} Private Zero initView () {mediaPlayer = New MediaPlayer (); }   

}

  Private Media Player Media Player; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.activity_main); InitView (); Try {MediaPlayer.setDataSource ("my link.mp3"); // // mediaPlayer.prepareAsync (); MediaPlayer.prepare ();   

// If you want async operation, then this Mehthod block U.L. MediaPlayer.prepareAsync ();

  mediaPlayer.start (); } Hold (exception e) {e.printStackTrace (); }}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -