我在this page上使用以下javascript,试图在有人点击视频缩略图时切换视频 .

<script>
    function replaceVideo(id) {
      originalSrc = jQuery(" iframe", "#" + id).attr("src");
      autoPlay = originalSrc + "&autoplay=1";
     jQuery(" iframe", "#" + id).attr("src", autoPlay);
      video = jQuery(" .video-content", "#" + id).html();
     jQuery("#video-page-gray-strip #video-page-content").html("");
      jQuery("#video-page-gray-strip #video-page-content").html(video);
      jQuery(" iframe", "#" + id).attr("src", originalSrc);
    }

    jQuery(".video-list li").click(function() {
      id = jQuery(this).attr("id");
      replaceVideo(id);
    });

    jQuery(window).load(function() {
      if(window.location.search.substring(1)) {
            element = window.location.search.substring(1).split('&');
            if (document.getElementById(element[0])) {
                document.onload = replaceVideo(element[0]);
            }
        }
    });
</script>

问题是当我点击缩略图时,视频没有切换,我收到以下控制台错误:

不安全的JavaScript尝试从URL为http://www.youtube.com/embed/OzOvsDVL_Q8?rel=0的框架访问URL为http://mountainfoodstorage.com/index.php/media的框架 . 域,协议和端口必须匹配 .

我想知道我是否必须更改JS以解决这个问题 . 如果是这样,我该如何解决?

谢谢!