From 742793b8d905dbcc237b446f1766900c3fa6d926 Mon Sep 17 00:00:00 2001 From: lizixian Date: Mon, 29 Mar 2021 11:02:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=20AudioSessionId=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lzx/starrysky/control/PlayerControl.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/starrysky/src/main/java/com/lzx/starrysky/control/PlayerControl.kt b/starrysky/src/main/java/com/lzx/starrysky/control/PlayerControl.kt index c8f2e94..d2c2f4b 100644 --- a/starrysky/src/main/java/com/lzx/starrysky/control/PlayerControl.kt +++ b/starrysky/src/main/java/com/lzx/starrysky/control/PlayerControl.kt @@ -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) } @@ -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,