2010-12-08 96 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”的含义,但它听起来像您需要检查视频是否与设备兼容或在批准的播放列表上在开始播放之前?

相关问题