5

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

blackHawk
  • 6,047
  • 13
  • 57
  • 100
  • check this [SO question](http://stackoverflow.com/questions/27573017/failed-to-execute-postmessage-on-domwindow-https-www-youtube-com-http) if it can help you:) – KENdi May 11 '16 at 08:53
  • The error is still but video is playing – blackHawk May 11 '16 at 13:27

0 Answers0