我正在尝试使用iframe加载html5widget,但是即使我使用http://w.soundcloud.com/,我也会收到错误消息:我无法加载来自http页面的https连接。我该如何解决这个问题呢?为什么soundcloud重定向到安全连接?
Tnx
编辑:
我正在使用safari,并得到了这个错误:[Error] Blocked a frame with origin "https://w.soundcloud.com" from accessing a frame with origin "http://dev.norwegiansounds.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
当我使用firefox时,没有任何问题。
下面是一个示例:
http://dev.norwegiansounds.com/projects/93/
编辑2:我还没有解决这个问题。我尝试创建一个完全空白的文件并复制常规的iframe嵌入代码而不对其进行编辑,但我仍然得到相同的错误。这只是mac上safari的一个问题。不是在我的手机上,也不是火狐。
发布于 2018-11-24 06:45:31
我的document.ready里有这段代码,
var player = SC.Widget($('iframe.sc-widget')[0]);我把它转换成:
setTimeout(function () {
var player = SC.Widget($('iframe.sc-widget')[0]);
}, 3000);我使用这个延迟实现了这个自定义的soundcloud播放器,而不是document ready,它可以工作。https://codepen.io/nickcolley/pen/uoCIy
https://stackoverflow.com/questions/19817389
复制相似问题