我正在使用cordova构建iOS应用程序。需要在应用程序上播放youtube视频并访问所有控件,如timeupdate,seek,ends等。
JS使用:Plyr.js Player js
我可以访问http / https,android(cordova)应用。在访问IOS平台时遇到以下错误。
Unable to post message to https://www.youtube.com. Recipient has origin file://.
和
Blocked a frame with origin "https://www.youtube.com"
from accessing a frame with origin "file://".
The frame requesting access has a protocol of "https",
the frame being accessed has a protocol of "file".
Protocols must match.
在我的html文件中,我添加了以下
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline'; script-src 'self' https://www.youtube.com/iframe_api https://www.youtube.com/ https://s.ytimg.com https://player.vimeo.com/api/player.js 'unsafe-inline' 'unsafe-eval'"/>
我缺少什么?
同样的问题参考:check here