Fix wrong last position when media player is closed and progress still reported
This commit is contained in:
committed by
Niels van Velzen
parent
bd959b7d45
commit
8cd11c888c
@@ -69,6 +69,7 @@ public class VideoManager implements IVLCVout.OnNewVideoLayoutListener {
|
||||
private long mForcedTime = -1;
|
||||
private long mLastTime = -1;
|
||||
private long mMetaDuration = -1;
|
||||
private long lastExoPlayerPosition = -1;
|
||||
|
||||
private boolean nativeMode = false;
|
||||
private boolean mSurfaceReady = false;
|
||||
@@ -169,7 +170,15 @@ public class VideoManager implements IVLCVout.OnNewVideoLayoutListener {
|
||||
}
|
||||
|
||||
public long getCurrentPosition() {
|
||||
if (nativeMode) return mExoPlayer.getCurrentPosition();
|
||||
if (nativeMode) {
|
||||
if (mExoPlayer == null) {
|
||||
return lastExoPlayerPosition;
|
||||
} else {
|
||||
long mExoPlayerCurrentPosition = mExoPlayer.getCurrentPosition();
|
||||
lastExoPlayerPosition = mExoPlayerCurrentPosition;
|
||||
return mExoPlayerCurrentPosition;
|
||||
}
|
||||
}
|
||||
|
||||
if (mVlcPlayer == null) return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user