【问题标题】:Embed Youtube Video inside iOS App in HD将 Youtube 视频以高清格式嵌入 iOS 应用程序
【发布时间】:2015-07-27 15:59:36
【问题描述】:

我尝试使用 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 的大小是全屏的。

【问题讨论】:

    标签: ios swift youtube uiwebview youtube-iframe-api


    【解决方案1】:

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

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

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

    Youtube iFrame API setPlaybackQuality ignored on mobile device

    Loading Youtube iFrame API video at a lower quality

    【讨论】:

      猜你喜欢
      • 2012-05-02
      • 2013-09-23
      • 2012-08-13
      • 1970-01-01
      • 1970-01-01
      • 2012-05-29
      • 1970-01-01
      • 2015-06-29
      • 2015-03-20
      相关资源
      最近更新 更多