YTPlayerView代码段
- (void)viewDidLoad {
[super viewDidLoad];
[self.playerView setDelegate:self];
[self.playerView loadVideoByURL:@"https://www.youtube.com/embed/xyz" startSeconds:2.0 suggestedQuality:kYTPlaybackQualityAuto];
}
答案 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]];