【问题标题】:Dailymotion "broke" HTTPS with video thumbnail (Chrome warning)Dailymotion“破坏”带有视频缩略图的 HTTPS(Chrome 警告)
【发布时间】:2015-08-16 20:03:20
【问题描述】:

我在网页中嵌入了 dailymotion 视频。我使用下面的代码来显示它。此代码通过 HTTP 而不是 HTTPS 调用视频的预览图片,而网页域在 HTTPS 上。

API 调用通过 HTTPS 协议发送:

document.location.protocol

因此,进入网页的所有资源都不会通过 HTTPS 发送,Chrome 会在 SSL 证书上显示警告。

<script>
// Dailymotion SDK 
(function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol + '//api.dmcdn.net/all.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
}());
window.dmAsyncInit = function()
{
    var player = DM.player("player", {video: "x254e00", width: "480", height: "270"});
    player.addEventListener("play", function(e)
    {
        $('.video_layer').hide();
    });
};

你有什么想法,如何强制这个 HTTPS 调用来进行图片预览?

【问题讨论】:

    标签: google-chrome ssl dailymotion-api mixed-content


    【解决方案1】:

    请求缩略图时存在错误,导致它们无法通过 https 传递。现在已经修复了。 现在谈谈嵌入:目前 Dailymotion 嵌入中的一些资源是在 HTTP 中加载的,但这仍然是 Dailymotion iframe 的本地资源,页面中的其他资源不受影响并继续通过 HTTPS 发送。

    【讨论】:

      猜你喜欢
      • 2015-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多