开发者

showing white screen when playing video

Hi white screen is showing if video is not in supported list. and there is no way user to go back to previous screen(navigation bar too not showing).and when i initialize the MPMoviePlayerController their retain count is increasing to 4.

here is my code

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;

}开发者_如何学编程

i am using ios4.2


Do not call retainCount. It is useless in production and misleading for debugging.

The retain count is entirely irrelevant to your question, it would seem. I'm not sure I understand exactly what "Hi white screen is showing if video is not in supported list" means, but it sounds like you need to check to see if the video is compatible with the device or on the approved playlist before you start playback?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜