From fd6809c127785d10a9ab125b589ef16d2732b45d Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 2 Sep 2024 08:30:05 +0200 Subject: [PATCH 1/2] 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 From e1756fd3518473926791f3e878d65ffc97fca8d0 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 1 Oct 2024 14:45:15 +0200 Subject: [PATCH 2/2] fix build Signed-off-by: alperozturk --- .../com/owncloud/android/ui/preview/PreviewMediaFragment.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 57df4dd3eed3..e0e5da728684 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 @@ -574,9 +574,8 @@ class PreviewMediaFragment : FileFragment(), OnTouchListener, Injectable { } override fun onPause() { - mediaPlayerServiceConnection?.pause() exoPlayer?.pause() - + releaseVideoPlayer() super.onPause() }