Description:
I have following code for an Audio player. I can continue Audio playback from any duration by clicking on Progress Bar(between 0-to-mediapl
First big problem is your order of initialization: you call getDuration before you actually call setDataSource in resetAndStartPlayer. How is MediaPlayer supposed to know duration without data source?
Here's how to do that properly:
call MediaPlayer.setDataSource() in Activity.onCreate
execute AsyncTask, in its doInBackground call MediaPlayer.prepare(), this will take a while if it's streaming from http, but after it finishes, player should know lenght of media
Important things: