fix duration problem

This commit is contained in:
Domingos Lopes 2016-05-11 12:27:26 -04:00
parent f80af4342f
commit 8edb262988
2 changed files with 3 additions and 2 deletions

View File

@ -481,7 +481,7 @@ public class FeedMedia extends FeedFile implements Playable {
setPosition(newPosition);
setLastPlayedTime(timeStamp);
if(startPosition>=0 && position > startPosition) {
setDuration(playedDurationWhenStarted + position - startPosition);
setPlayedDuration(playedDurationWhenStarted + position - startPosition);
}
DBWriter.setFeedMediaPlaybackInformation(this);
}

View File

@ -316,11 +316,12 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight());
}
// TODO this call has no effect!
if (media.getPosition() > 0) {
seekToSync(media.getPosition());
}
if (media.getDuration() == 0) {
if (media.getDuration() <= 0) {
Log.d(TAG, "Setting duration of media");
media.setDuration(mediaPlayer.getDuration());
}