MPMoviePlayerViewController 无法播放 youtube
可能的重复:
使用 MPMoviePlayerController 而不是 UIWebView 播放 YouTube 视频
我使用此代码
-(void)viewDidLoad
{
[super viewDidLoad];
NSString *movieURL = @"http://www.youtube.com/watch?v=hH4sHqDEjSg";
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:movieURL]];
moviePlayer.moviePlayer.shouldAutoplay = YES;
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
[moviePlayer release];
}
但这没有用。我建议这样是错误的吗?或者有一些我想念的东西。
那么你能帮助我或指导我吗:)
Possible Duplicate:
Play YouTube videos with MPMoviePlayerController instead of UIWebView
I use this code
-(void)viewDidLoad
{
[super viewDidLoad];
NSString *movieURL = @"http://www.youtube.com/watch?v=hH4sHqDEjSg";
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:movieURL]];
moviePlayer.moviePlayer.shouldAutoplay = YES;
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
[moviePlayer release];
}
But It didn't work. I suggest this likg is wrong ? or there's something I miss.
So Could you help me or Guide me please : )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MPMoviePlayerViewController
不播放 youtube 视频,我们必须使用我使用过的嵌入代码,它工作正常。youtube 视频无法在模拟器上运行,请在设备上尝试MPMoviePlayerViewController
not playing youtube vidoes we have to use embeded code i used and its works fine.youtube videos not run on simulator try in on device