mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
Remove unreachable branches in video completion handling
It is never the case that `loopVideos == true` in the `videoCompleted` handler, since enabling that preference sets `repeatMode`, which in turn prevents the player from reaching `STATE_ENDED`. Thus, the branches are unreachable.
This commit is contained in:
parent
e83db406a9
commit
9877cbaf2c
2 changed files with 6 additions and 14 deletions
|
@ -347,14 +347,10 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
|||
|
||||
clearLastVideoSavedProgress()
|
||||
mCurrTime = (mExoPlayer!!.duration / 1000).toInt()
|
||||
if (config.loopVideos) {
|
||||
resumeVideo()
|
||||
} else {
|
||||
video_seekbar.progress = video_seekbar.max
|
||||
video_curr_time.text = mDuration.getFormattedDuration()
|
||||
pauseVideo()
|
||||
}
|
||||
}
|
||||
|
||||
private fun didVideoEnd(): Boolean {
|
||||
val currentPos = mExoPlayer?.currentPosition ?: 0
|
||||
|
|
|
@ -681,14 +681,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
|||
}
|
||||
|
||||
mCurrTime = (mExoPlayer!!.duration / 1000).toInt()
|
||||
if (listener?.videoEnded() == false && mConfig.loopVideos) {
|
||||
playVideo()
|
||||
} else {
|
||||
mSeekBar.progress = mSeekBar.max
|
||||
mCurrTimeView.text = mDuration.getFormattedDuration()
|
||||
pauseVideo()
|
||||
}
|
||||
}
|
||||
|
||||
private fun cleanup() {
|
||||
pauseVideo()
|
||||
|
|
Loading…
Reference in a new issue