mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +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()
|
clearLastVideoSavedProgress()
|
||||||
mCurrTime = (mExoPlayer!!.duration / 1000).toInt()
|
mCurrTime = (mExoPlayer!!.duration / 1000).toInt()
|
||||||
if (config.loopVideos) {
|
|
||||||
resumeVideo()
|
|
||||||
} else {
|
|
||||||
video_seekbar.progress = video_seekbar.max
|
video_seekbar.progress = video_seekbar.max
|
||||||
video_curr_time.text = mDuration.getFormattedDuration()
|
video_curr_time.text = mDuration.getFormattedDuration()
|
||||||
pauseVideo()
|
pauseVideo()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun didVideoEnd(): Boolean {
|
private fun didVideoEnd(): Boolean {
|
||||||
val currentPos = mExoPlayer?.currentPosition ?: 0
|
val currentPos = mExoPlayer?.currentPosition ?: 0
|
||||||
|
|
|
@ -681,14 +681,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
}
|
}
|
||||||
|
|
||||||
mCurrTime = (mExoPlayer!!.duration / 1000).toInt()
|
mCurrTime = (mExoPlayer!!.duration / 1000).toInt()
|
||||||
if (listener?.videoEnded() == false && mConfig.loopVideos) {
|
|
||||||
playVideo()
|
|
||||||
} else {
|
|
||||||
mSeekBar.progress = mSeekBar.max
|
mSeekBar.progress = mSeekBar.max
|
||||||
mCurrTimeView.text = mDuration.getFormattedDuration()
|
mCurrTimeView.text = mDuration.getFormattedDuration()
|
||||||
pauseVideo()
|
pauseVideo()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun cleanup() {
|
private fun cleanup() {
|
||||||
pauseVideo()
|
pauseVideo()
|
||||||
|
|
Loading…
Reference in a new issue