본문 바로가기
Error

Failed to execute 'postMessage' on 'DOMWindow': https://www.youtube.com !== http://localhost:9000

by pavi03 2022. 5. 26.

[JavaScript Youtube API]

 

this.player = new window['YT'].Player('player', {
    videoId: this.mediaid,
    width: '100%',
    playerVars: { 
        'autoplay': 1,
        'controls': 0,
        'autohide': 1,
        'wmode': 'opaque',
        'origin': 'http://localhost:8100' 
    },
}

여기서 origin을 추가해야하는 경우도 있는거 같지만, 나는 단순히 youtube Link를 video_id로 변경해주지 않아서 생기는 문제였다.

 

 

https://stackoverflow.com/questions/27573017/failed-to-execute-postmessage-on-domwindow-https-www-youtube-com-http