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秒了嗎?
謝謝。