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() }