From e1b461e2f1ec14a37026b89251ce7acb06db3897 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 24 May 2017 22:49:01 +0200 Subject: [PATCH] small edits at videoplayer setup --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 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 0626adf14..6f7acd6d9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -52,6 +52,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { mView = inflater.inflate(R.layout.pager_video_item, container, false) + setupPlayer() medium = arguments.getSerializable(MEDIUM) as Medium if (savedInstanceState != null) { @@ -59,7 +60,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } mIsFullscreen = activity.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN - setupPlayer() activity.window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> val fullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 @@ -289,7 +289,8 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) { - setVideoSize() + if (width != 0 && height != 0) + setVideoSize() } override fun surfaceDestroyed(holder: SurfaceHolder) {