Dailymotion通过视频缩略图“打破”HTTPS(Chrome警告)

时间:2015-08-16 20:03:21

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

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

使用HTTPS协议发送API调用:

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调用以进行图片预览?

1 个答案:

答案 0 :(得分:0)

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

相关问题