Skip to content

Commit

Permalink
[bugfix] 1.修复播放页概率在后台还播放的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
heyanlin committed Feb 13, 2024
1 parent 11ed93d commit 584aab3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ class CartoonPlayingViewModel(
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
private suspend fun innerPlay(playerInfo: PlayerInfo, adviceProcess: Long) {
exoPlayer.pause()
if (lastJob?.isCancelled != false || lastJob?.isActive != true) {
return
}
if (this.playingInfo != null) {
if (
playingInfo?.uri == playerInfo.uri
Expand Down Expand Up @@ -294,6 +297,7 @@ class CartoonPlayingViewModel(
if (_playingState.value.isPlaying && !exoPlayer.playWhenReady && exoPlayer.isMedia()) {
trySaveHistory()
}
lastJob?.cancel()
exoPlayer.pause()
}

Expand Down

0 comments on commit 584aab3

Please sign in to comment.