Skip to content

Commit

Permalink
Check existence of file
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Jul 26, 2024
1 parent d5a438e commit cbe5d38
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -749,16 +749,16 @@ 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.isAudio(it) && mediaPlayerServiceConnection?.isPlaying == false) {
stopAudio()
} else if (MimeTypeUtil.isVideo(it) && exoPlayer != null && exoPlayer?.isPlaying == true) {
savedPlaybackPosition = exoPlayer?.currentPosition ?: 0L
exoPlayer?.pause()
}
}

mediaPlayerServiceConnection?.unbind()

super.onStop()
}

Expand Down

0 comments on commit cbe5d38

Please sign in to comment.