【问题标题】:Page does not show <iframe> with youtube video in Mozilla Firefox在 Mozilla Firefox 中,页面不显示带有 youtube 视频的 <iframe>
【发布时间】:2016-08-23 05:00:39
【问题描述】:

我正在使用&lt;iframe&gt; 如下所示,在我的页面中显示来自 youtube 的视频>

&lt;iframe src="http://www.youtube.com/v/DNLh8p3aUzQ" disallowfullscreen=""&gt;&lt;/iframe&gt;

它在 Chrome、IE、Edge 中运行良好,但在 Mozilla Firefox 中根本不显示视频,它会尝试下载视频,如下所示:

这可能是什么问题?

谢谢。

【问题讨论】:

  • 你在视频末尾多了一个 "disallowfullscreen '

标签: html firefox iframe embed


【解决方案1】:

请注意,Mozilla 不再支持 Adob​​e Flash,因此当浏览器获取“application/x-sockwave-flash”时,它会自动下载它,因为它不知道如何处理它。
相反,您应该使用 YouTube 分享选项(在视频下选择“分享”,然后选择“嵌入”),它为您提供了将其嵌入到所有浏览器的“iframe”中的正确方法(使用 HTML5)。
在您的情况下,在“iframe”中使用的正确网址是 https://www.youtube.com/embed/DNLh8p3aUzQ

【讨论】:

    【解决方案2】:

    点击 iframe 后或网站加载后要下载?也许检查 Firefox 插件...

    【讨论】:

    • 不,我想我已经明白发生了什么,这不是问题,但无论如何谢谢。
    【解决方案3】:

    看看这个小提琴,它也让它响应https://jsfiddle.net/x5q411jk/

    /* Flexible iFrame */
     
    .flexible-container {
        position: relative;
        padding-bottom: 56.25%;
        padding-top: 30px;
        height: 0;
        overflow: hidden;
    }
     
    .flexible-container iframe,   
    .flexible-container object,  
    .flexible-container embed {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    <!-- Responsive iFrame -->
    <div class="flexible-container">
    <iframe src="https://www.youtube.com/embed/DNLh8p3aUzQ" width="560px" height="315px" frameborder="0" style="border:0"></iframe>
    </div>

    【讨论】:

      猜你喜欢
      • 2016-11-11
      • 2018-02-12
      • 1970-01-01
      • 2017-08-27
      • 1970-01-01
      • 2016-05-15
      • 2016-05-22
      • 2017-03-02
      • 2016-09-17
      相关资源
      最近更新 更多