Skip to content

Commit

Permalink
No need file type check to stop exoPlayer, service
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Jul 30, 2024
1 parent cbe5d38 commit f7f2cdc
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit f7f2cdc

Please sign in to comment.