Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 AVAudioSessionCategoryPlayback 类别下有一个 AVAudioSession。我需要能够在屏幕锁定时停止或暂停播放。有什么办法可以做到这一点?
到目前为止,唯一会中断我的音频会话的是来电。
提前致谢!
AVAudioSessionCategoryPlayback设计为在屏幕锁定时不暂停音频。唯一被屏幕锁定静音的类别是AVAudioSessionCategoryAmbient和AVAudioSessionCategorySoloAmbient。
AVAudioSessionCategoryPlayback
AVAudioSessionCategoryAmbient
AVAudioSessionCategorySoloAmbient
查看音频会话编程指南中的AVAudioSession 类别表。