Skip to content

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

@urm9ril

Description

@urm9ril

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions