在iPhone 3.1和4.0中播放电影

时间:2010-07-26 22:57:16

标签: iphone mpmovieplayercontroller backwards-compatibility movie iphone-4

在iPhone 3.1中,我使用以下代码播放电影:

moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.movieControlMode = MPMovieControlModeDefault;
moviePlayer.backgroundColor = [UIColor blackColor];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];  
[moviePlayer play]; 

出于某种原因,这在iPhone 4.0中不再起作用了(去Apple吧!)。我应该如何在iPhone 4.0中播放电影,同时保持与iPhone 3.1的向后兼容性?

0 个答案:

没有答案