【问题标题】:Handle iPhone interruption in a music application处理音乐应用程序中的 iPhone 中断
【发布时间】:2010-08-17 04:40:53
【问题描述】:

我已经尝试了代码以避免睡眠模式中断。它正在工作,但现在当有电话或短信进入 iPhone 时,我遇到了中断问题。我的音乐应用程序中的歌曲当时停止了。我想在通话结束后自动恢复停止播放的歌曲。

- (void) audioPlayerBeginInterruption: (AVAudioPlayer *) player {

if (playing) {

    playing = NO;

    interruptedOnPlayback = YES;

    [self updateViewForPlayerState];

}

}


- (void) audioPlayerEndInterruption: (AVAudioPlayer *) player {

if (interruptedOnPlayback) {

    [player prepareToPlay];

    [player play];

    playing = YES;

    interruptedOnPlayback = NO;

}

}

但它不起作用。请在这里帮助我,在此先感谢。

【问题讨论】:

    标签: iphone objective-c avaudioplayer


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-05
      • 1970-01-01
      相关资源
      最近更新 更多