Подтвердить что ты не робот

Как использовать API iFrame YouTube в Chrome и Firefox?

У меня есть видеоролик YouTube встроенный на моем сайте, с помощью iFrame. Я хочу использовать API для приостановки видео, но в Chrome я получаю сообщение об ошибке:

Unsafe JavaScript attempt to access frame with URL http://subdomain.example.com/ from frame with URL http://www.youtube.com/embed/KmtzQCSh6xk?enablejsapi=1&origin=http://subdomain.example.com. Domains, protocols and ports must match.

В Firefox (3.6) я получаю эту ошибку:

Permission denied for <http://www.youtube.com> to call method Location.toString on <http://subdomain.example.com>.

Я попытался поместить iFrame в себя или добавить его с помощью API. В любом случае игрок входит, но у меня нет контроля над ним API.

Здесь соответствующая часть моего кода:

<div id="player"></div>

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

var player;
function onYouTubePlayerAPIReady() {
    player = new YT.Player('player', {
        height: '433',
        width: '731',
        videoId: 'KmtzQCSh6xk'
      });
}

$("#pause_button").click(function(){
  alert("Pausing " + player);//is undefined :(
  player.pauseVideo();
});

</script>

Как мне получить браузеры, чтобы позволить iFrame YouTube получить доступ к основному кадру моей страницы?

Спасибо!

4b9b3361