gpt4 book ai didi

ios - 将 Youtube 视频以高清格式嵌入 iOS 应用程序

转载 作者:行者123 更新时间:2023-11-29 02:01:52 25 4
gpt4 key购买 nike

我尝试使用 YouTube 生成的 iframe 在 iOS 应用中嵌入 YouTube 视频,但无法以高清格式显示该视频。

我生成的 iframe 没有建议、播放器控件和最佳隐私。我尝试输入参数 vq=hd1080vq=large 但不起作用。

iframe的大小我应用的是与屏幕大小相同的:

webView.loadHTMLString("<html><body style=\"(margin:0)\"><embed width=\"\(view.frame.width)\" height=\"\(view.frame.height)\" src=\"https://www.youtube.com/embed/*********?rel=0&amp;showinfo=0\" frameborder=\"0\" allowfullscreen></embed></body></html>", baseURL: nil)

WebView 的大小是全屏。

最佳答案

您所看到的是移动设备上 iFrame API 的副产品。

根据关于 this issue 的讨论在 YouTube 的 iOS Helper Class 存储库(它只是为您在 UIWebView 中加载 iFrame 播放器,而不必手动设置所有内容)上,YouTube 不允许开发人员强制使用高质量视频以防止移动设备上的数据使用过多。

可以在以下问题中找到进一步的讨论(和解决方法):

Youtube iFrame API setPlaybackQuality ignored on mobile device

Loading Youtube iFrame API video at a lower quality

关于ios - 将 Youtube 视频以高清格式嵌入 iOS 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30264386/

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