[Cpp] view plaincopyprint? Import files to the. h file
Import the. h file to the database [cpp]
# Import <MediaPlayer/MPMoviePlayerViewController. h>
# Import <MediaPlayer/MPMoviePlayerViewController. h>
[Cpp] view plaincopyprint? In the. m implementation file
In the. m implementation file, [cpp]
NSString * path = [[NSBundle mainBundle] pathForResource: @ "name" ofType: @ "mp4"];
NSURL * URL = [[NSURL alloc] initFileURLWithPath: path];
MPMoviePlayerViewController * _ moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL: URL];
[[Self GetViewController: self. view] presentMoviePlayerViewControllerAnimated: _ moviePlayerController];
[_ MoviePlayerController. moviePlayer play];
NSString * path = [[NSBundle mainBundle] pathForResource: @ "name" ofType: @ "mp4"];
NSURL * URL = [[NSURL alloc] initFileURLWithPath: path];
MPMoviePlayerViewController * _ moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL: URL];
[[Self GetViewController: self. view] presentMoviePlayerViewControllerAnimated: _ moviePlayerController];
[_ MoviePlayerController. moviePlayer play];