The target origin provided does not match the recipient window's origin: audio is coming but not video

心不动则不痛 提交于 2019-12-10 14:55:27

问题


The complete error is "Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://localhost:8100').", this is what im doing in index.html file, the audio is coming but video is not.

  <script>
  var tag = document.createElement('script');
  tag.src = "https://www.youtube.com/iframe_api";
  var firstScriptTag = document.getElementsByTagName('script')[0];
  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

  // Replace the 'ytplayer' element with an <iframe> and
  // YouTube player after the API code downloads.
  var player;
  function onYouTubePlayerAPIReady() {
  player = new YT.Player('ytplayer', {
  height: '390',
  width: '640',
  videoId: 'jdqsiFw74Jk'
  });
  }
  </script>

Also i want to send video id from page to index.html

来源:https://stackoverflow.com/questions/37133215/the-target-origin-provided-does-not-match-the-recipient-windows-origin-audio-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!