I am making a media player application in which i have a Mp3 file URL that i need to http stream down over Android MediaPlayer.
Now My Streaming is working very fine . Song is getting downloaded and Played Successfully. But i need to show the Downloading and Song Progress over a ProgressBar/SeekBar. As soon i got my initial data buffer filled with some song data my streamer plays the song.
But i need to know the total duration of song so that i can set the Progress Bar accordingly. As soon my Media Player starts playing the song. I call
mediaPlayer.getDuration() for getting the file duration .. But it is not giving me the right data untill the whole song get downloaded....
This is bad . as it seems getDuration() Method of MediaPlayer is showing the duration on the basis of downloaded content instead of checking the header of Mp3 file.....
I am following the tutorial for Http streaming audio song from the following Link
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/
Any Help would be appreciated. Thanks