问题
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