- NSString *urlString = [NSString stringWithString:@"视频url"];
- NSURL *movieUrl = [[NSURL alloc] initWithString:urlString];
- MPMoviePlayerController *myMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieUrl];
- myMoviePlayer.view.frame = CGRectMake(250, 250, 350, 350);
- [self.view addSubview:myMoviePlayer.view];
- myMoviePlayer.shouldAutoplay = YES;
- myMoviePlayer.scalingMode= MPMovieScalingModeAspectFit;
- [myMoviePlayer play];