From 15d3328b3551a24e4bfb24f97bcd69f65863b401 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 4785d2d728a9..57df4dd3eed3 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 @@ -573,6 +573,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