【问题标题】:Vimeo video embed on iOS6 not working嵌入在 iOS6 上的 Vimeo 视频无法正常工作
【发布时间】:2013-06-02 15:55:52
【问题描述】:

我正在尝试嵌入 Vimeo 链接,但它在 iOS6 上不起作用。奇怪的是它在 iOS5 上运行良好,但升级破坏了它。发生的情况是用户按下播放后,进度指示将开始并挂在那里而不会播放。

我也在使用最新的嵌入代码:

<div class="video-container">
    <iframe data-videoid="<?php echo $video; ?>" src="http://player.vimeo.com/video/<?php echo $video; ?>?api=1&amp;player_id=<?php echo $video; ?>" width="100%" height="100%" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>

Here's an example link where it doesn't work.

【问题讨论】:

  • 它对我有用。我在 6.1.3

标签: ios html ios6 vimeo video-embedding


【解决方案1】:

如果您使用 webview 加载视频,请使用以下代码,它适用于 ios 6。

 NSString *embedHTML =[NSString stringWithFormat:@"\
                              <html><head>\
                              <style type=\"text/css\">\
                              body {\
                              background-color: #666666;\
                              padding:%f %f %f %f;\
                              color: blue;\
                              }\
                              </style>\
                              </head><body style=\"margin:0\">\
                              <iframe height=\"%f\" width=\"%f\" title=\"Vimeo Video\" class=\"vimeo\" src=\"http://player.vimeo.com/video/%@\" ></iframe>\
                              </body></html>",paddingTop,paddingRight,paddingBottom,paddingLeft,videoHeight,videoWidth,vimeoID];
        [self.webView loadHTMLString:embedHTML baseURL:nil];

【讨论】:

    【解决方案2】:

    原因是因为我在父容器上进行了 CSS 3D 变换...哎呀!

    【讨论】:

      猜你喜欢
      • 2011-09-15
      • 2013-01-12
      • 1970-01-01
      • 2017-06-04
      • 2013-04-06
      • 2014-06-29
      • 2020-09-17
      • 2022-01-14
      • 1970-01-01
      相关资源
      最近更新 更多