2014-12-05 96 views
1

我有一種我無法理解的奇怪情況。我爲MediaPlayer設置了一個查找,調用.play(),並且將來在10秒內查找。代碼:Android MediaPlayer:開始播放後找錯了

Log.d(TAG, "start: seek before start " + mediaPlayer.getCurrentPosition()); 
mediaPlayer.start(); 
Log.d(TAG, "start: current seek right after start " + mediaPlayer.getCurrentPosition()); 
try { Thread.sleep(50); 
    } catch (InterruptedException ignored) {} 
Log.d(TAG, "start: current seek after 50 ms after start is " + mediaPlayer.getCurrentPosition()); 

和日誌,我們有下一個:

D/PlayerActivity﹕ start: seek before start 449586 
D/PlayerActivity﹕ start: current seek right after start 0 
D/PlayerActivity﹕ start: current seek after 50 ms after start is 457883 

我不明白爲什麼它向前移動10秒了嗎?
謝謝。

回答

0

似乎根本原因是mp3文件中的錯誤metainf。與MediaPlayer無關......

相關問題