adding some null checks at handling video end

This commit is contained in:
tibbi 2018-07-18 14:44:52 +02:00
parent 92718e5666
commit 3831800715

View file

@ -431,7 +431,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
} }
private fun videoEnded() = mExoPlayer!!.currentPosition >= mExoPlayer!!.duration private fun videoEnded() = mExoPlayer?.currentPosition ?: 0 >= mExoPlayer?.duration ?: 0
private fun setProgress(seconds: Int) { private fun setProgress(seconds: Int) {
mExoPlayer!!.seekTo(seconds * 1000L) mExoPlayer!!.seekTo(seconds * 1000L)