MPMoviePlayerViewController 问题-Iphone

发布于 2024-11-17 10:18:50 字数 667 浏览 8 评论 0原文

我想为此实现电影播放器​​,我正在使用 MPMoviePlayerViewController。

我的代码是,

moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL]; 

moviePlayerController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming; 
[self presentModalViewController:moviePlayerController animated:YES]; 
[[moviePlayerController moviePlayer] play];

但它不断加载但不播放视频。我的代码有什么问题。

我的要求是,

在电影播放器​​中,当我单击“完成”按钮时,它会转到我开始的页面。

感谢您的考虑和努力

编辑:

任何使用 MPMoviePlayerController 而不是使用 MPMoviePlayerViewController 的示例代码请给我。(请给我您实现的示例代码,因为我无法理解教程代码)请帮助我

I want to implement the movie player for that,i'm using MPMoviePlayerViewController.

My code is,

moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL]; 

moviePlayerController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming; 
[self presentModalViewController:moviePlayerController animated:YES]; 
[[moviePlayerController moviePlayer] play];

but it's continuously loading and not playing the video.What i'm wrong with my code.

My requirement is,

In the movie player,when i'm click on the done button it goes to the page which i'm starting from.

Thank you for your consideration and effort

Edit:

Any sample code for using MPMoviePlayerController instead of using MPMoviePlayerViewController please give me.(please give me your implemented sample code because i can't understand the tutorial code)please help me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的他你的她 2024-11-24 10:18:50
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"aaa" ofType:@"mp4"];  
NSURL *fileURL = [NSURL fileURLWithPath:filepath];  
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; 
[moviePlayerController.view setFrame:CGRectMake(0, 70, 320, 270)]; 
[self.view addSubview:moviePlayerController.view];  
moviePlayerController.fullscreen = YES;  
[moviePlayerController play];
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"aaa" ofType:@"mp4"];  
NSURL *fileURL = [NSURL fileURLWithPath:filepath];  
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; 
[moviePlayerController.view setFrame:CGRectMake(0, 70, 320, 270)]; 
[self.view addSubview:moviePlayerController.view];  
moviePlayerController.fullscreen = YES;  
[moviePlayerController play];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文