Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未捕获错误:在嵌入Youtube视频的NPObject错误上调用方法时出错_Javascript_Html_Youtube - Fatal编程技术网

Javascript 未捕获错误:在嵌入Youtube视频的NPObject错误上调用方法时出错

Javascript 未捕获错误:在嵌入Youtube视频的NPObject错误上调用方法时出错,javascript,html,youtube,Javascript,Html,Youtube,我有一个HTML页面,其中嵌入了youtube视频,代码如下: <iframe width="600" height="338" src="http://www.youtube-nocookie.com/embed/aUHdhfghhahlY?autohide=1&amp;theme=light&loop=1&playlist=edkAiJxQWHQ&amp;hd=1&amp;modestbranding=1&amp;

我有一个HTML页面,其中嵌入了youtube视频,代码如下:

<iframe width="600" 
     height="338" 
     src="http://www.youtube-nocookie.com/embed/aUHdhfghhahlY?autohide=1&amp;theme=light&loop=1&playlist=edkAiJxQWHQ&amp;hd=1&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0&amp;wmode=transparent&amp;autoplay=1" >
</iframe>
未捕获错误:调用NPObject上的方法时出错


如何避免此错误?

“youtube nocookie.com”将HTTP请求重定向到HTTPS,但使用页面内部不安全的源。因此,如果你无法访问“youtube nocookie.com”的来源,你就无能为力。如果有,请仅使用HTTPS源或防止重定向到HTTPS。

如何防止重定向?
Blocked a frame with origin "https://www.youtube-nocookie.com" from accessing a frame with origin "http://www.domain.com".  The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.