Avoid seeking to position 0 (#208).

This commit is contained in:
daniel oeh 2013-12-30 02:47:13 +01:00
parent 162e1d4f98
commit aba5568176
1 changed files with 6 additions and 2 deletions

View File

@ -211,9 +211,10 @@ public class PlaybackServiceMediaPlayer {
setSpeed(Float.parseFloat(UserPreferences.getPlaybackSpeed()));
mediaPlayer.start();
if (playerStatus == PlayerStatus.PREPARED) {
if (playerStatus == PlayerStatus.PREPARED && media.getPosition() > 0) {
mediaPlayer.seekTo(media.getPosition());
}
setPlayerStatus(PlayerStatus.PLAYING, media);
pausedBecauseOfTransientAudiofocusLoss = false;
if (android.os.Build.VERSION.SDK_INT >= 14) {
@ -323,7 +324,10 @@ public class PlaybackServiceMediaPlayer {
videoSize = new Pair<Integer, Integer>(vp.getVideoWidth(), vp.getVideoHeight());
}
mediaPlayer.seekTo(media.getPosition());
if (media.getPosition() > 0) {
mediaPlayer.seekTo(media.getPosition());
}
if (media.getDuration() == 0) {
if (AppConfig.DEBUG)
Log.d(TAG, "Setting duration of media");