开发者

MPMoviePlayerViewController problem

开发者 https://www.devze.com 2023-01-15 03:42 出处:网络
How can I play a movie in my app? I tried using this code, but xcode gives me this error: NSBundle *bundle = [NSBundle mainBundle];

How can I play a movie in my app? I tried using this code, but xcode gives me this error:

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];  开发者_如何学编程 

ERROR

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


Please notice that MPMoviePlayerViewController only available on iOS3.2 and later

Double check for that, I think that is the issue. More here about MPMoviePlayerViewController

0

精彩评论

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