Fixed miniplayer position after start
Casting magic values to int is not a good idea...
This commit is contained in:
parent
6d3fc04f52
commit
8c6f40b0a2
|
@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.service.playback;
|
|||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.view.SurfaceHolder;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.DefaultLoadControl;
|
||||
import com.google.android.exoplayer2.DefaultRenderersFactory;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
|
@ -120,6 +121,9 @@ public class ExoPlayerWrapper implements IPlayer {
|
|||
|
||||
@Override
|
||||
public int getDuration() {
|
||||
if (mExoPlayer.getDuration() == C.TIME_UNSET) {
|
||||
return PlaybackServiceMediaPlayer.INVALID_TIME;
|
||||
}
|
||||
return (int) mExoPlayer.getDuration();
|
||||
}
|
||||
|
||||
|
|
|
@ -450,7 +450,8 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
|||
|| playerStatus == PlayerStatus.PAUSED
|
||||
|| playerStatus == PlayerStatus.PREPARED) {
|
||||
retVal = mediaPlayer.getDuration();
|
||||
} else if (media != null && media.getDuration() > 0) {
|
||||
}
|
||||
if (retVal <= 0 && media != null && media.getDuration() > 0) {
|
||||
retVal = media.getDuration();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue