【发布时间】:2019-03-07 11:07:29
【问题描述】:
我正在尝试在我的网络应用程序中实现一个 youtube 播放器。为此,我使用了以下反应库
react-youtube https://github.com/troybetz/react-youtube
我已经实现了它并在本地主机中工作,没有任何问题。但它在生产版本中停止工作。它给出了如下错误
Refused to load the script 'https://www.youtube.com/iframe_api' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
这是什么原因造成的,我该如何解决?
【问题讨论】:
标签: javascript reactjs youtube youtube-api content-security-policy