fix #1725, properly remember last video playback position, if paused

This commit is contained in:
tibbi 2020-01-27 23:04:18 +01:00
parent f4c02d1168
commit 3e7f99fc01

View file

@ -273,8 +273,12 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
} }
private fun saveVideoProgress() { private fun saveVideoProgress() {
if (!videoEnded() && mExoPlayer != null) { if (!videoEnded()) {
if (mExoPlayer != null) {
mConfig.saveLastVideoPosition(mMedium.path, mExoPlayer!!.currentPosition.toInt() / 1000) mConfig.saveLastVideoPosition(mMedium.path, mExoPlayer!!.currentPosition.toInt() / 1000)
} else {
mConfig.saveLastVideoPosition(mMedium.path, mPositionAtPause.toInt() / 1000)
}
} }
} }