gpt4 book ai didi

ios - YTPlayerView(youTube)付款者未在iOS 11中播放视频

转载 作者:行者123 更新时间:2023-12-03 06:13:48 26 4
gpt4 key购买 nike

我正在尝试使用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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com