Skip to content

Commit

Permalink
fix AudioSessionId 获取不到问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lizixian committed Mar 29, 2021
1 parent fb407a2 commit 742793b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ class PlayerControl(
isRunningTimeTask = true
val position = getPlayingPosition()
val duration = getDuration()
val effectSwitch = StarrySkyConstant.keyEffectSwitch
if (effectSwitch) {
StarrySky.effect().attachAudioEffect(getAudioSessionId())
}
progressListener.forEach {
it.value.onPlayProgress(position, duration)
}
Expand Down Expand Up @@ -576,6 +572,10 @@ class PlayerControl(
when (playbackStage.stage) {
PlaybackStage.PLAYING -> {
timerTaskManager?.startToUpdateProgress()
val effectSwitch = StarrySkyConstant.keyEffectSwitch
if (effectSwitch) {
StarrySky.effect().attachAudioEffect(getAudioSessionId())
}
}
PlaybackStage.PAUSE,
PlaybackStage.ERROR,
Expand Down

0 comments on commit 742793b

Please sign in to comment.