我知道我们可以通过 kAudioSessionProperty_OtherAudioIsPlaying 检测其他音频应用程序是否正在播放音乐,但是,即使其他应用程序的音乐暂停,此属性也会返回相同的值,所以我的问题是,我如何检测其他音频流是否是暂停还是播放?有谁能够帮助我?非常感谢!!
最佳答案
使用这样的代码:
[notificationCenter addObserver: self
selector: @selector (handlerPlaybackStateChanged:)
name: MPMusicPlayerControllerPlaybackStateDidChangeNotification
object: nil];
[[MPMusicPlayerController iPodMusicPlayer] beginGeneratingPlaybackNotifications];
关于ios - IOS检测其他音乐是否暂停?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8665808/