【发布时间】:2026-01-24 05:50:01
【问题描述】:
我正在寻找一种方法来处理 AppleTV 上的 Siri 中断。
根据本指南:https://developer.apple.com/documentation/avfoundation/avaudiosession/responding_to_audio_session_interruptions 应该可以获得音频会话中断的通知,但这似乎不起作用。
我试过了
NotificationCenter.default.addObserver(
self,
selector: #selector(handleInterruption(_:)),
name: .AVAudioSessionInterruption,
object: nil)
回调永远不会发生。
我想要的是在用户使用 Siri 时暂停视频,然后在他们完成后继续播放。
【问题讨论】: