fix duration problem
This commit is contained in:
parent
f80af4342f
commit
8edb262988
|
@ -481,7 +481,7 @@ public class FeedMedia extends FeedFile implements Playable {
|
||||||
setPosition(newPosition);
|
setPosition(newPosition);
|
||||||
setLastPlayedTime(timeStamp);
|
setLastPlayedTime(timeStamp);
|
||||||
if(startPosition>=0 && position > startPosition) {
|
if(startPosition>=0 && position > startPosition) {
|
||||||
setDuration(playedDurationWhenStarted + position - startPosition);
|
setPlayedDuration(playedDurationWhenStarted + position - startPosition);
|
||||||
}
|
}
|
||||||
DBWriter.setFeedMediaPlaybackInformation(this);
|
DBWriter.setFeedMediaPlaybackInformation(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,11 +316,12 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
||||||
videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight());
|
videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO this call has no effect!
|
||||||
if (media.getPosition() > 0) {
|
if (media.getPosition() > 0) {
|
||||||
seekToSync(media.getPosition());
|
seekToSync(media.getPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (media.getDuration() == 0) {
|
if (media.getDuration() <= 0) {
|
||||||
Log.d(TAG, "Setting duration of media");
|
Log.d(TAG, "Setting duration of media");
|
||||||
media.setDuration(mediaPlayer.getDuration());
|
media.setDuration(mediaPlayer.getDuration());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue