- (IBAction)bofang:(id)sender {
NSString *path [email protected]"http://115.231.158.26/video.sinosns.cn/hlj/nzsccdkxlr.mp4";
NSURL *url =[NSURL URLWithString:path];
self.movie =[[MPMoviePlayerController alloc]initWithContentURL:url];
[self.movie.view setFrame:CGRectMake(0, 0, 320, 568)];
[self.view addSubview:self.movie.view];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(endmovie) name:MPMoviePlayerPlaybackDidFinishNotification object:self.movie];
[self.movie play];
}
- (IBAction)two:(id)sender {
NSString *path [email protected]"http://115.231.158.26/video.sinosns.cn/hlj/nzsccdkxlr.mp4";
NSURL *url =[NSURL URLWithString:path];
MPMoviePlayerViewController *movie =[[MPMoviePlayerViewController alloc]initWithContentURL:url];
[movie.moviePlayer prepareToPlay];
[self presentMoviePlayerViewControllerAnimated:movie];
}
- (IBAction)three:(id)sender {
NSString *path [email protected]"http://115.231.158.26/video.sinosns.cn/hlj/nzsccdkxlr.mp4";
NSURL *url =[NSURL URLWithString:path];
MXLMediaView *mediaView =[[MXLMediaView alloc]init];
[mediaView setDelegate:self];
// [mediaView showVideoWithURL:url inParentView:self.view completion:^{
// NSLog(@"Complete");
// }];
[mediaView showVideoWithURL:url inParentView:self.view completion:nil];
NSLog(@"播放视频");
}
-(void)endmovie{
[self.movie stop];
[self.movie.view removeFromSuperview];
}