Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.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
YouTube iframe API http/https协议和源问题_Iframe_Https_Youtube_Safari_Youtube Iframe Api - Fatal编程技术网

YouTube iframe API http/https协议和源问题

YouTube iframe API http/https协议和源问题,iframe,https,youtube,safari,youtube-iframe-api,Iframe,Https,Youtube,Safari,Youtube Iframe Api,我在YouTube iframe API中遇到了各种http/https和源代码错误,这只是Safari的一个问题(我认为在大多数版本中,我使用的是7.0.4版) 我发现以下错误: 无法将邮件发布到。收件人有来源 以及: 阻止原点为“”的帧访问原点为“”的帧。请求访问的帧具有“https”协议,被访问的帧具有“http”协议。协议必须匹配 结果是视频仍为黑色,有时视频中有播放图标。视频通常会被加载,这是相当随机的。视频本身是自动播放的,因此无需点击。所有其他浏览器都表现良好 创建播放器时,原点参

我在YouTube iframe API中遇到了各种http/https和源代码错误,这只是Safari的一个问题(我认为在大多数版本中,我使用的是7.0.4版)

我发现以下错误:

无法将邮件发布到。收件人有来源

以及:

阻止原点为“”的帧访问原点为“”的帧。请求访问的帧具有“https”协议,被访问的帧具有“http”协议。协议必须匹配

结果是视频仍为黑色,有时视频中有播放图标。视频通常会被加载,这是相当随机的。视频本身是自动播放的,因此无需点击。所有其他浏览器都表现良好

创建播放器时,原点参数的设置如下:

playerVars: {
    origin: 'http://example.com'
}
YouTube本身的加载方式如下:

var tag = document.createElement('script');
tag.src = "//www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
我尝试指定“”;我也会犯同样的错误。我的域名是http而不是https——我猜这是问题的根源,我不知道如何阻止youtube默认使用https