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()