DFPlayer
DFPlayer copied to clipboard
AVAudioSessionInterruptionNotification 的监听, 执行会有延时?
操作步骤如下: 1 - 使用DF播放一个MP3 2 - 切到后台, 使用其他播放器中断DF的播放 3 - 暂停其他播放器的播放, 回到DF的前台
大约 20s后才会执行到, NSLog(@"----------------------:结束打断"); 这里
-
(void)df_playerAudioBeInterrupted:(NSNotification *)notification {
NSInteger InterruptionType = [[notification.userInfo objectForKey:AVAudioSessionInterruptionTypeKey] integerValue]; switch (InterruptionType) { case AVAudioSessionInterruptionTypeBegan: { NSLog(@"----------------------:开始打断"); } break; case AVAudioSessionInterruptionTypeEnded: { NSLog(@"----------------------:结束打断"); } break; default: break; }