Switching between multiple videos triggers a widget api error
jordanjoecooper opened this issue · 3 comments
jordanjoecooper commented
I had experienced this within a code base I am currently working on and noticed it in the demo example here, to recreate in the demo:
- Play a video on the main page.
- Select the link at the bottom that states 'heres another video'
- The above triggers the following Message in the console:
www-widgetapi.js:100 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://ember-youtube.surge.sh').
Unsure as to what causes this I have seen other frameworks with the same problem and multiple solutions proposed for each but nothing definitive.
oskarrough commented
Thanks, I also see that all the time… quite annoying.
I did a quick test, which seems to remove the warning once deployed. Note, it'll still show up in localhost although it doesn't seem to do anything.
playerVars = {
origin: 'https://emberyoutube.now.sh'
}
@T4JC can you verify on https://emberyoutube.now.sh?
jordanjoecooper commented
Can confirm that fixes it on the demo site, awesome, thank you!
oskarrough commented
I added it to the readme, cheers!