From 034f3b5c568357464c51dee1c09be03650ab692a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Jun 2017 07:44:10 +0200 Subject: [PATCH] make sure mSurfaceView isnt null when initing media player --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 +++- 1 file changed, 3 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 c5a556f82..f9b3a604c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -95,7 +95,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee super.setMenuVisibility(menuVisible) mIsFragmentVisible = menuVisible if (menuVisible) { - initMediaPlayer() + if (mSurfaceView != null) + initMediaPlayer() + if (context?.config?.autoplayVideos == true) { playVideo() }