我想知道 - 当 AVPlayer
开始播放时,用户的音乐会发生什么情况?什么都没发生,它停止了,还是这个 Action 取消了?如果是这样,我将如何检查用户是否正在播放音乐?
Apple 的文档让我很困惑。
最佳答案
好吧,为此查找信息,如果应用程序的 AVAudioSession
类别设置为 Solo,
,默认值。AVAudioPlayer
对象似乎只会中断用户的音频环境
我看到了这个答案:App with AVPlayer plays mp4 interrupt iPod music after launched
我还在 Apple Developer 文档中看到了这张表,它解释了不同类别是否会打断用户的音乐,并提供了不同场景的示例,包括游戏场景:https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Sound.html#//apple_ref/doc/uid/TP40006556-CH44-SW1
为了不打断用户的音乐,我需要将其设置为Ambient
。
关于ios - AVPlayer 会停止用户的音乐吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29858173/