diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index cea66cd8e..77dffb031 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -1104,7 +1104,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun gotMedia(thumbnailItems: ArrayList) { val media = thumbnailItems.asSequence().filter { it is Medium && !mIgnoredPaths.contains(it.path) }.map { it as Medium }.toMutableList() as ArrayList - if (isDirEmpty(media) || media.hashCode() == mPrevHashcode) { + if (isDirEmpty(media) || media.hashCode() == mPrevHashcode || (getCurrentFragment() as? VideoFragment)?.mIsPlaying == true) { return } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 4debc2c65..76da0d990 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -44,7 +44,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private var mWasFragmentInit = false private var mIsPanorama = false private var mIsFragmentVisible = false - private var mIsPlaying = false private var mIsDragged = false private var mWasVideoStarted = false private var mWasPlayerInited = false @@ -55,6 +54,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private var mDuration = 0 private var mPositionWhenInit = 0 private var mPositionAtPause = 0L + var mIsPlaying = false private var mExoPlayer: SimpleExoPlayer? = null private var mVideoSize = Point(1, 1)