youtube YTPlayerView没有响应

时间:2015-04-28 11:27:50

标签: ios youtube-api

YTPlayerView代码段

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.playerView setDelegate:self];
    [self.playerView loadVideoByURL:@"https://www.youtube.com/embed/xyz" startSeconds:2.0 suggestedQuality:kYTPlaybackQualityAuto];
}

1 个答案:

答案 0 :(得分:-1)

我发现这个课程已经过时且难以使用。 这是我的解决方案(尽管没有代表)

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.youtube.com/embed/%@",tubeId]];
UIWebView *web = [[UIWebView alloc] initWithFrame:webFrame];
[self.view addSubview:web];
[web loadRequest:[NSURLRequest requestWithURL:url]];