gpt4 book ai didi

ios - YTPlayerView 并不总是全屏

转载 作者:行者123 更新时间:2023-11-29 06:01:21 27 4
gpt4 key购买 nike

我正在尝试显示 YouTube 视频,但有时 YTPlayerView 会全屏显示,有时则不会。我希望它始终处于全屏状态。我怎样才能实现它?

ytView = [[YTPlayerView alloc] initWithFrame:self.view.bounds];
ytView.backgroundColor = self.view.backgroundColor;
ytView.delegate = self;
NSDictionary *playvarsDic = @{ @"controls" : @1, @"playsinline" : @0, @"autohide" : @1, @"showinfo" : @1, @"autoplay": @1, @"modestbranding" : @1 };
[ytView loadWithVideoId:firstImage.Source playerVars: playvarsDic];

最佳答案

playerViewDidBecomeReady中手动设置playerView.webView.allowsInlineMediaPlayback = false以强制播放器进入webview。

关于ios - YTPlayerView 并不总是全屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54649984/

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