From e87cc4a86ded9f06fe65a3941d2a822cc1553ee4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 18:56:38 +0200 Subject: [PATCH] add an extra check at initializing video media player at menu visibility change --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 f9b3a604c..93a050fe0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -95,8 +95,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee super.setMenuVisibility(menuVisible) mIsFragmentVisible = menuVisible if (menuVisible) { - if (mSurfaceView != null) + if (mSurfaceView != null && mSurfaceHolder!!.surface.isValid) { initMediaPlayer() + } if (context?.config?.autoplayVideos == true) { playVideo()