1

I am following a previous question on this topic trying to get a video to play inside my app. I have copied the video called iobserve1.mov into the resources folder and in my h file I import MediaPlayer/MediaPlayer.h. I am getting the following errors:

Apple Mach-O Linker Error "_OBJC_CLASS_$_MPMoviePlayerController", referenced from:

and

Apple Mach-O Linker Error linker command failed with exit code 1 (use -v to see invocation)

@interface ObViewControllerIObserveMovie ()
@property (weak, nonatomic) IBOutlet UIView *movieView; // this should point to a view where the movie will play
@end

@implementation ObViewControllerIObserveMovie

- (void)viewDidLoad
{
[super viewDidLoad];
NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"iobserve1" ofType:@"mov"];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]];
player.view.frame = CGRectMake(184, 200, 400, 300);
[self.view addSubview:player.view];
[player play];
}

Any help here would be much appreciated.

RGriffiths
  • 5,722
  • 18
  • 72
  • 120

1 Answers1

1

Have you added the MediaPlayer framework to your project? It contains the MPMediaPlayerController classes

iain
  • 5,660
  • 1
  • 30
  • 51
  • Search for "adding frameworks in xcode" on google or http://stackoverflow.com/questions/3352664/how-to-add-existing-frameworks-in-xcode-4 – Popeye Mar 12 '13 at 17:22
  • Got you. Great stuff thanks. While it now appears to work and load nothing actually plays. Any ideas? – RGriffiths Mar 12 '13 at 17:26
  • Sorry that's a completely different question you will have to ask. – Popeye Mar 12 '13 at 17:47