2013-01-08 80 views
1

我有一個MPMoviePlayerController的問題。我用來玩shoutcast。 t被設計爲當應用程序進入背景時播放,並且一切正常。問題是,當它在後臺,我得到一個來電。在這種情況下,流暫停,但通話結束後不會返回。MPMoviePlayerController和來電

回答

2

我曾在我的應用程序中使用MPMoviePlayerviewController進行流媒體直播音頻播放。

它對我來說工作得很好。並且我的信息流也暫停&也會在通話結束後回來。我有

沒問題。我在做類似聲明會話屬性的一些變化像

下面

在我的代碼,我播放視頻:

NSError *setCategoryErr = nil; 
    NSError *activationErr = nil; 
    [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryErr]; 
    [[AVAudioSession sharedInstance] setActive: YES error: &activationErr]; 
    [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; 
    UIBackgroundTaskIdentifier newTaskId = UIBackgroundTaskInvalid; 
    newTaskId = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:NULL]; 
+0

而且我覺得在MPMoviePlayerviewController它在內置功能,通話流後自動回來...我認爲。 – Vishal

+0

MP endInterruptionFromInterruptor ::在1.000000恢復播放我有這個錯誤... – Flexoid

相關問題