How to get mp3 file duration Http streamed over Android MediaPlayer
<p>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.</p>

<p>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.</p>

<p>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</p>

<p>mediaPlayer.getDuration() for getting the file duration .. 
But it is not giving me the right data untill the whole song get downloaded....</p>

<p>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.....</p>

<p>I am following the tutorial for Http streaming audio song from the following Link</p>

<p><a href="http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/" rel="nofollow">http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/</a></p>

<p>Any Help would be appreciated.
Thanks</p>
