DFPlayer icon indicating copy to clipboard operation
DFPlayer copied to clipboard

AVAudioSessionInterruptionNotification 的监听, 执行会有延时?

Open urm9ril opened this issue 5 years ago • 0 comments

操作步骤如下: 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; }

urm9ril avatar Aug 07 '20 10:08 urm9ril