Youtube API iframe

I am using youtube iframe api to use youtube video player on my webpage. It works well in browsers, and all tracking features work well. But the problem is that I get an error message in the Chrome Chrome browser "Unable to send message to https://www.youtube.com . The recipient has the beginning https://www.mydomain.com ". Here is the code.

<script src="http://www.youtube.com/player_api"></script>
<iframe width="450" height="253" src="https://www.youtube.com/embed/EpOvTyklFxc?rel=0" frameborder="0" allowfullscreen id="yes"></iframe>
<script language="javascript">
    var player;
        function onYouTubePlayerAPIReady() {        
            player = new YT.Player('yes', {
                events: {
                'onReady': function(){ alert("yes!"); }
                }
            });
        }
</script>

Please help me solve this problem.

+4
source share

All Articles