Skip to content

Commit

Permalink
Merge pull request nextcloud#13322 from nextcloud/bugfix/NPE-mime-typ…
Browse files Browse the repository at this point in the history
…e-on-preview-media-activity

Check Existence of File in onStop().PreviewMediaActivity
  • Loading branch information
alperozturk96 authored Aug 5, 2024
2 parents cf222d4 + 0d69db1 commit d1931bf
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -749,16 +749,15 @@ class PreviewMediaActivity :
override fun onStop() {
Log_OC.v(TAG, "onStop")

val file = file
if (MimeTypeUtil.isAudio(file) && mediaPlayerServiceConnection?.isPlaying == false) {
stopAudio()
} else if (MimeTypeUtil.isVideo(file) && exoPlayer != null && exoPlayer?.isPlaying == true) {
savedPlaybackPosition = exoPlayer?.currentPosition ?: 0L
exoPlayer?.pause()
file?.let {
if (MimeTypeUtil.isVideo(it) && exoPlayer != null && exoPlayer?.isPlaying == true) {
savedPlaybackPosition = exoPlayer?.currentPosition ?: 0L
}
}

exoPlayer?.pause()
stopAudio()
mediaPlayerServiceConnection?.unbind()

super.onStop()
}

Expand Down

0 comments on commit d1931bf

Please sign in to comment.