Xcode Tutorial: How to play a Video

Опубликовано: 31 Июль 2026
на канале: ipodtouchhelper09
32,500
41

Here is the code:


NSString *moviePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"video.mp4"];

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]];

moviePlayer.movieControlMode = MPMovieControlModeDefault;

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];

[moviePlayer play];



Check out my new website: http://empowereddesignapps.tk

Please Subscribe Rate And Comment!