Assumed Prerequisite: Your project uses ARC .
MPMoviePlayerController , ARC , . , , MPMoviePlayerController playMovie.
, SRViewController .
:
@instance SRViewController
[...]
@property (nonatomic,strong) MPMoviePlayerController *player;
[...]
@end
:
@implementation SRViewController
[...]
-(IBAction)playMovie
{
NSString *url = [[NSBundle mainBundle]
pathForResource:@"OntheTitle" ofType:@"mov"];
self.player = [[MPMoviePlayerController alloc]
initWithContentURL: [NSURL fileURLWithPath:url]];
self.player.view.frame = CGRectMake(10, 10, 720, 480);
[self.view addSubview:self.player.view];
[self.player play];
}
[...]
@end