MPMoviePlayerViewController

MPMoviePlayerViewController

如何在我的应用中播放电影?我尝试使用此代码,但是xcode给了我这个错误:

NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"welcome" ofType:@"mp4"];
NSURL  *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
movieView = [[MPMoviePlayerViewController alloc] initWithContentURL: movieURL];
theMovie = [movieView moviePlayer];
theMovie.scalingMode = MPMovieScalingModeAspectFit;
theMovie.fullscreen = TRUE;
theMovie.controlStyle = MPMovieControlStyleNone;
theMovie.shouldAutoplay = TRUE;

[[[UIApplication sharedApplication] keyWindow] addSubview: movieView.view];


错误

ld: warning: in /Users/Rushil/Documents/StickDeath/MediaPlayer.framework/MediaPlayer, missing required architecture i386 in file
Undefined symbols:
  "_OBJC_CLASS_$_MPMoviePlayerViewController", referenced from:
      objc-class-ref-to-MPMoviePlayerViewController in StickDeathViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

最佳答案

请注意,MPMoviePlayerViewController仅在iOS3.2和更高版本上可用

仔细检查一下,我认为这就是问题所在。 More here about MPMoviePlayerViewController

关于iphone - MPMoviePlayerViewController问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3632802/

10-11 15:37