回答

0

註冊爲MPMoviePlayerLoadStateDidChangeNotification。在其處理程序中,檢查當前的loadstate並掩蓋MPMovieLoadStateStalled

- (void)MPMoviePlayerLoadStateDidChange:(NSNotification *)notification 
{ 
    //is the player stalled, hence possibly starving? 
    if ((movieController_.loadState & MPMovieLoadStateStalled) == MPMovieLoadStateStalled) 
    { //yes->do something 
     NSLog(@"hey there, I am starving to death here"); 
    } 
} 

您可能想要在上面的if-子句中註冊一個定時器 - 例如,持續10秒。一旦寶寶沒有進一步的狀態改變時間,請做一些終止/跳過視頻播放。

0

我不確定,但我認爲可以使用performSelector作爲計時器嗎?

[self performSelector:@selector(checkTimeout:) withObject:theMovie afterDelay:15]; 

然後檢查電影狀態。