From fe61fdd66abaede867d975c455ce284332de2a7e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 11 Dec 2016 22:51:02 +0100 Subject: [PATCH] rely on the null check inside initMediaPlayer() --- .../simplemobiletools/gallery/fragments/VideoFragment.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index f246c5cec..822d09004 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -289,9 +289,7 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C if (activity == null) return - if (mMediaPlayer == null) - initMediaPlayer() - + initMediaPlayer() val videoProportion = mMediaPlayer!!.videoWidth.toFloat() / mMediaPlayer!!.videoHeight.toFloat() val display = activity.windowManager.defaultDisplay val screenWidth: Int @@ -344,9 +342,7 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C } override fun onStartTrackingTouch(seekBar: SeekBar) { - if (mMediaPlayer == null) - initMediaPlayer() - + initMediaPlayer() mMediaPlayer!!.pause() mIsDragged = true }