Youtube api 在沙盒iframe中嵌入youtube iframe失败

Youtube api 在沙盒iframe中嵌入youtube iframe失败,youtube-api,youtube-iframe-api,Youtube Api,Youtube Iframe Api,当将youtube iframe嵌入到另一个iframe时,该iframe是沙盒(以防止XSS),播放器在所有主要浏览器中都保持黑色 看 沙盒iframe问题 我遇到了同样的问题,必须设置以下沙盒属性才能工作 sandbox=“允许脚本允许相同来源” 更多信息允许同时使用脚本和相同的源代码,实际上会使沙盒 Uncaught DOMException: Failed to read the 'cookie' property from 'Document': The document is san

当将youtube iframe嵌入到另一个iframe时,该iframe是沙盒(以防止XSS),播放器在所有主要浏览器中都保持黑色

沙盒iframe问题
我遇到了同样的问题,必须设置以下沙盒属性才能工作

sandbox=“允许脚本允许相同来源”


更多信息

允许同时使用脚本和相同的源代码,实际上会使沙盒
Uncaught DOMException: Failed to read the 'cookie' property from 'Document':
The document is sandboxed and lacks the 'allow-same-origin' flag.
at Vb.m.get (https://www.youtube.com/yts/jsbin/www-embed-player-vflwaq4V_/www-embed-player.js:142:47)
Access to XMLHttpRequest at 'https://www.youtube.com/error_204?...'
from origin 'null' has been blocked by CORS policy:
Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.