【问题标题】:YTPlayerView (youTube) Payer is not playing video in iOS 11YTPlayerView (youTube) Payer 不在 iOS 11 中播放视频
【发布时间】:2018-04-14 17:00:12
【问题描述】:

我正在尝试在 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 objective-c youtube sdk


    【解决方案1】:

    您是否尝试将播放器添加到容器中然后开始播放视频?

    【讨论】:

      猜你喜欢
      • 2017-07-08
      • 2015-10-29
      • 2018-05-09
      • 2016-03-18
      • 1970-01-01
      • 2013-02-09
      • 2015-11-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多