草庐IT

objective-c - MPMoviePlayerViewController 无法播放 youtube

coder 2024-01-27 原文

<分区>

Possible Duplicate:
Play YouTube videos with MPMoviePlayerController instead of UIWebView

我用这个代码

-(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];
}

但是没有用。我建议这个 likg 是错误的?或者有什么我想念的。

所以你能帮我或指导我吗:)

有关objective-c - MPMoviePlayerViewController 无法播放 youtube的更多相关文章

随机推荐