From 0be1ae9f30dc81778bec24792adf29a874cceec4 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 2 Sep 2024 08:30:05 +0200 Subject: [PATCH] pause audio/video when swiping away Signed-off-by: tobiasKaminsky --- .../owncloud/android/ui/preview/PreviewMediaFragment.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.kt b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.kt index f939dbf8ecfc..d002fe6649e1 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.kt +++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.kt @@ -676,6 +676,13 @@ class PreviewMediaFragment : FileFragment(), OnTouchListener, Injectable { super.onDetach() } + override fun onPause() { + mediaPlayerServiceConnection?.pause() + exoPlayer?.pause() + + super.onPause() + } + companion object { private val TAG: String = PreviewMediaFragment::class.java.simpleName