fix: harden startup proxy and coordinate handling

This commit is contained in:
xweiba
2026-08-06 12:17:23 +08:00
parent 881270a21a
commit 0e8e83fd33
26 changed files with 708 additions and 266 deletions
+11 -1
View File
@@ -17,7 +17,7 @@ final class BackgroundKeepAlive {
guard isActive, let info = notification.userInfo,
let type = info[AVAudioSessionInterruptionTypeKey] as? UInt,
type == AVAudioSession.InterruptionType.ended.rawValue else { return }
start()
restartAfterInterruption()
RuntimeLogger.info("APP", "KeepAlive", "音频中断恢复")
}
@@ -50,6 +50,16 @@ final class BackgroundKeepAlive {
RuntimeLogger.info("APP", "KeepAlive", "后台保活已启动(静音音频)")
}
private func restartAfterInterruption() {
guard isActive else { return }
playerNode?.stop()
engine?.stop()
playerNode = nil
engine = nil
isActive = false
start()
}
func stop() {
guard isActive else { return }
isActive = false