2010-12-08 134 views
0

嗨 如果視頻不在支持列表中,將顯示白屏。有沒有辦法用戶回到前一屏幕(導航欄也未顯示)。而 當我初始化的MPMoviePlayerController其保持數增加至4播放視頻時顯示白屏

這裏是我的代碼

mMPMovieViewCont=[[MPMoviePlayerViewController alloc]initWithContentURL:theURL]; 
     [theURL release]; 
     theURL=nil; 
     [[NSNotificationCenter defaultCenter] addObserver:self 
                selector:@selector(movieDidFinishForOS4:) 
                 name:MPMoviePlayerPlaybackDidFinishNotification 
                 object:nil]; 

     [self.navigationController presentMoviePlayerViewControllerAnimated:mMPMovieViewCont]; 
     NSLog(@"%d",[mMPMovieViewCont retainCount]); //**here count is 4** 
- (void) movieDidFinishForOS4:(NSNotification*)notification { 

mMPMovieViewCont.moviePlayer.initialPlaybackTime=-1.0;  
[mMPMovieViewCont dismissMoviePlayerViewControllerAnimated]; 
[[NSNotificationCenter defaultCenter] removeObserver:self 
               name:MPMoviePlayerPlaybackDidFinishNotification 
               object:nil]; 
NSLog(@"%d",[mMPMovieViewCont retainCount]); //returning 3 

[mMPMovieViewCont release]; 
mMPMovieViewCont = nil; 

}

我正在使用ios4.2

回答

1

不要調用retainCount。它在生產中沒有用,並且對調試有誤導性。

保留數與您的問題完全無關,看起來似乎。我不確定我是否確切理解「Hi white screen is shown if video is not in supported list」的含義,但它聽起來像您需要檢查視頻是否與設備兼容或在批准的播放列表上在開始播放之前?

相關問題