From f7f2cdcd4f6930b0f26cc9c47e0814b2588286da Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 30 Jul 2024 10:53:18 +0200 Subject: [PATCH] No need file type check to stop exoPlayer, service Signed-off-by: alperozturk --- .../owncloud/android/ui/preview/PreviewMediaActivity.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt index 2d258215e9e7..1d5d3e4e4c6d 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt +++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt @@ -750,14 +750,13 @@ class PreviewMediaActivity : Log_OC.v(TAG, "onStop") file?.let { - if (MimeTypeUtil.isAudio(it) && mediaPlayerServiceConnection?.isPlaying == false) { - stopAudio() - } else if (MimeTypeUtil.isVideo(it) && exoPlayer != null && exoPlayer?.isPlaying == true) { + if (MimeTypeUtil.isVideo(it) && exoPlayer != null && exoPlayer?.isPlaying == true) { savedPlaybackPosition = exoPlayer?.currentPosition ?: 0L - exoPlayer?.pause() } } + exoPlayer?.pause() + stopAudio() mediaPlayerServiceConnection?.unbind() super.onStop() }