使用Youtube iframe API时出现postMessage错误

时间:2018-01-10 13:40:18

标签: youtube-iframe-api

似乎Youtube iframe API最近在他们的iframe API中引入了一个错误。

这是直接从Youtube iframe demo page

中提取的错误示例
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://google-developers.appspot.com').
g.C @ www-widgetapi.js:116
g.G @ www-widgetapi.js:113
setInterval (async)
ab @ www-widgetapi.js:89
kb @ www-widgetapi.js:114
W @ www-widgetapi.js:98
Y @ www-widgetapi.js:118
createYTPlayer @ as3_demo_functions.js:385
onYouTubePlayerAPIReady @ as3_demo_functions.js:424
(anonymous) @ www-widgetapi.js:140
(anonymous) @ www-widgetapi.js:140
10:33:24.521 

知道怎么解决这个问题吗?假设设置origin应该可以防止这种情况发生,但似乎他们没有在他们的JS中正确使用origin

0 个答案:

没有答案