google-chrome - Dailymotion "broke"带有视频缩略图的 HTTPS(Chrome 警告)

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

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

使用 HTTPS 协议(protocol)可以很好地发送 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 调用图片预览?

最佳答案

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

关于google-chrome - Dailymotion "broke"带有视频缩略图的 HTTPS(Chrome 警告),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32039386/

相关文章:

javascript - Webkit浏览器: click event handler doe not work properly

ssl - 无法在 Apache 2.4.18 中禁用 TLSv1/TLSv1.1

angular - 使用自己的类型发布 angular 包 - 类型引用包含错误的路径

php - Dailymotion API 上传速率限制

javascript - 如何在 Chrome 扩展程序或控制台命令中提取 JavaScript 源代码?

javascript - 设置样式位置 : absolute 时,Chrome 对象标签加载多次

javascript - 重复使用 HTML5 音频对象重复播放相同的 mp3 音效

linux - curl 错误 "no alternative certificate.."

php - SSL 文件夹 - 访问不安全的内容

android - 如何获取dailymotion视频列表