我正在尝试使用UITableViewCell
播放YouTube视频,但在iOS 11中不起作用。下面是代码。
CGRect videoFrame = CGRectMake(0, 0, cell.videoPlayerView.bounds.size.width, 211);
YTPlayerView *player = [[YTPlayerView alloc]initWithFrame:videoFrame];
NSString *videoId = [[BARUtility shared] getYoutubeVideoId:content.featuredVideoUrl];
NSDictionary *playerVars = @{@"controls" : @"0",
@"playsinline" : @"0",
@"rel" : @"0"};
if (videoId.length > 0) {
[player loadWithVideoId:videoId playerVars:playerVars];
[cell.videoPlayerView addSubview:player];
}
最佳答案
您是否尝试过将播放器添加到容器中然后开始播放视频?
关于ios - YTPlayerView(youTube)付款者未在iOS 11中播放视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47070746/