【发布时间】:2010-08-28 09:40:17
【问题描述】:
我在 iphone 4.0 操作系统中播放视频时遇到崩溃问题。实际上,我已经使用基本 SDK 3.0 创建了应用程序,现在我只是将应用程序安装到 4.0 OS 设备。
它不起作用...我已经调试了那个问题,发现在 4.0 操作系统中,苹果更改了播放视频的框架和方法。
谁能帮我解决这个问题。
这是我在 3.0 操作系统中运行良好的代码。
-(void)play
{
NSBundle *bundle = [NSBundle mainBundle];
//NSString *path = [bundle pathForResource:@"Icon" ofType:@"png"];
NSString *path = [bundle pathForResource:@"loader" ofType:@"m4v"];
NSURL *url = [NSURL fileURLWithPath:path];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
moviePlayer.movieControlMode = MPMovieControlModeHidden;
[moviePlayer play];
}
提前致谢, 普拉格尼什
【问题讨论】:
标签: iphone video operating-system mpmovieplayercontroller iphone-4