【问题标题】:Youtube page loading in UIWebView and not the video在 UIWebView 而不是视频中加载 Youtube 页面
【发布时间】:2012-05-10 08:30:43
【问题描述】:
    NSString *youTubeHTMLTemplate = @"<html><body style=\"margin:0;padding:0;\"><iframe class=\"youtube-player\" type=\"text/html\" width=\"%f\" height=\"%f\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\" allowfullscreen></iframe></body></html>";
    finalHtml = [NSString stringWithFormat:youTubeHTMLTemplate, htmlFrameWidth, htmlFrameHeight, videoID];
[videoWebView loadHTMLString:finalHtml baseURL:nil]; 

上面的代码可以正确加载视频(仅),但如果我提供小的高度和宽度(

知道这里有什么问题吗?

【问题讨论】:

    标签: html uiwebview io youtube embed


    【解决方案1】:

    我找到了这个。如果有人觉得有用,请写一个答案。 这是来自 YouTube 的 JS API 文档 “要为关键的播放器功能留出空间,播放器的尺寸必须至少为 200 x 200 像素。”

    【讨论】:

      猜你喜欢
      • 2013-02-21
      • 1970-01-01
      • 2014-04-02
      • 2010-12-19
      • 1970-01-01
      • 2014-12-04
      • 2013-02-10
      • 2011-11-23
      • 1970-01-01
      相关资源
      最近更新 更多