【问题标题】:Iframe facebook video embed does not work on mobile devicesiframe facebook 视频嵌入在移动设备上不起作用
【发布时间】:2013-10-17 16:57:47
【问题描述】:

您好,我在我的网站上使用此代码来显示 facebook 视频:

<iframe src="https://www.facebook.com/video/embed?video_id=XX" width="640" height="480" frameborder="0"></iframe>

问题:它不能在移动设备上运行(它需要不可能的 fash payer 安装)

它尝试使用 facebook 工具在网站上集成视频帖子: http://nsa34.casimages.com/img/2013/10/17/131017070157521369.png

例子:

<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/fr_FR/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-post" data-href="https://www.facebook.com/photo.php?v=589822344439680" data-width="550"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/photo.php?v=589822344439680">Publication</a> de <a href="https://www.facebook.com/AmazingCrazyVideos">Amazing and Crazy videos</a>.</div></div>

这个效果很好,但它不仅显示视频.. 我只需要视频

我试过这个:

<object width="400" height="224" > 
 <param name="allowfullscreen" value="true" /> 
 <param name="allowscriptaccess" value="always" /> 
 <param name="movie" value="http://www.facebook.com/v/xxx" /> 
 <embed src="http://www.facebook.com/v/xxx" type="application/x-shockwave-flash"  
   allowscriptaccess="always" allowfullscreen="true" width="400" height="224"> 
 </embed> 
</object> 

它不起作用。

【问题讨论】:

    标签: facebook iframe


    【解决方案1】:

    这是我使用的代码...您只需更改视频 video_id=628132747223650 和他的高度和宽度就可以了

    1. 这是普通文本。
    2. 原来是这样,但现在跟在代码块后面:

      <iframe src="http://www.facebook.com/video/embed?video_id=628132747223650" height="320" width="540" frameborder="0"></iframe>
      

    【讨论】:

      【解决方案2】:

      如果您希望视频在 div 中正确调整大小,只需将宽度设置为 100%。 示例:

      &lt;iframe src="http://www.facebook.com/video/embed?video_id=785565964819891" width="100%" frameborder="0"&gt;&lt;/iframe&gt;

      【讨论】:

        【解决方案3】:

        尝试增加 iframe 的 z-index 它对我有用。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-10-09
          • 2020-01-13
          相关资源
          最近更新 更多