开发者

Playing movie in iPhone 3.1 and 4.0

开发者 https://www.devze.com 2023-01-08 18:57 出处:网络
In iPhone 3.1 I used the following code to play a movie: moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

In iPhone 3.1 I used the following code to play a movie:

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]; 

For some reason this does not work anymore in iPhone 4.0 (go Apple!). How should I play a movie in iPhone 4.0 开发者_如何学Pythonwhile retaining backward-compatibility with iPhone 3.1?

0

精彩评论

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