MediaPlayer.getDuration () дает неверное значение или 0 в Android 2.1 - PullRequest
4 голосов
/ 04 января 2012

Я работаю над приложением потокового аудио в Android. У меня возникают следующие проблемы в Android Media Player.

         1 MediaPlayer.getDuration() method returning 0 at sometime 
         but still its playing the song.
       2 some times MediaPlayer.getDuration() method returning wrong duration.
    **Some more info**
       1 I am caching the files from the server to the sdcard and
         streaming it to the media player through local http.
       2 All songs which is streamed is only mp3 files.
       3 Gives Correct duration when the network is good.

       If you guys find any fixes please direct me to the possible solution.

Thanks in advance.
...