Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8650515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:50:30+00:00 2026-06-12T13:50:30+00:00

Here I am with another question, this time about the youtube API. I’m using

  • 0

Here I am with another question, this time about the youtube API.
I’m using this code to get a youtube player:

<div id=\"youtubeVideoContainer\"></div><script type=\"text/javascript\">
                        //Load player api asynchronously.
                        var tag = document.createElement('script');
                        tag.src = \"//www.youtube.com/player_api\";
                        var firstScriptTag = document.getElementsByTagName('script')[0];
                        firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

                        var player;
                        function onYouTubePlayerAPIReady() {
                            player = new YT.Player('youtubeVideoContainer', {
                              height        : \"".$height."\",
                              width         : \"".$width."\",
                              videoId       : \"".$id."\",
                              playerVars    : ".json_encode($this->playerParams)."
                            });
                        }
                    </script>

Please don’t mind the \”, it is rendered in PHP, so it’s just for escaping, also, the video is playing, so no major errors 🙂

What does annoy me, is everytime I request a video, I see this message in my console:
Unsafe JavaScript attempt to access frame with URL

https://www.socialthisday.com/playwin/admin/content/edit/project_1/home.html
from frame with URL
https://www.youtube.com/embed/2UJH9dCtp7w?autohide=1&autoplay=1&controls=0&border&cc_load_policy=0&color&color1&color2&disablekb&enablejsapi=1&egm&fs&hd&iv_load_policy&loop&modestbranding=1&origin=https%3A%2F%2Fwww.socialthisday.com&playerapiid&playlist&rel=0&showinfo=0&showsearch&start&theme&version=3.
Domains, protocols and ports must match.

I would like to fix this so I don’t see that message. I know it isn’t really a major thing, but I like to now how I can get a youtube player on my site without seeing the warning above.

Hopefully you guys can help me out!

EDIT:
This is the output:

<div id="YTcontainer_502513c7ebc1b">&nbsp;</div>
                        <script type="text/javascript">
                            //Load player api asynchronously.
                            var tag = document.createElement('script');
                            tag.src = "//www.youtube.com/iframe_api";
                            var firstScriptTag = document.getElementsByTagName('script')[0];
                            firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

                            var YTplayer_502513c7eb834;                                                        
                            window.onYouTubeIframeAPIReady = function() {
                                YTplayer_502513c7eb834   = new YT.Player("YTcontainer_502513c7ebc1b", {
                                  height        : "200",
                                  width         : "200",
                                  videoId       : "2UJH9dCtp7w",
                                  playerVars    : {"autohide":1,"autoplay":1,"controls":0,"border":"","cc_load_policy":0,"color":"","color1":"","color2":"","disablekb":"","enablejsapi":"","egm":"","fs":"","hd":"","iv_load_policy":"","loop":"","modestbranding":1,"origin":"","playerapiid":"","playlist":"","rel":0,"showinfo":0,"showsearch":"","start":"","theme":"","version":3,"wmode":"opaque"}
                                });
                            }

                            if(window.YT){
                                onYouTubeIframeAPIReady();
                            }
                        </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:50:31+00:00Added an answer on June 12, 2026 at 1:50 pm

    The underlying issue is http://code.google.com/p/chromium/issues/detail?id=17325

    Once that’s resolved, the warnings in the JavaScript console on pages that use the YouTube iframe embed should go away—certainly for Chrome, and I believe for Safari as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello guys here with another question, regarding sql server 2008 r2 this time about
I had another question about this issue, but I didn't ask properly, so here
Another question about Web proxy. Here is my code: IWebProxy Proxya = System.Net.WebRequest.GetSystemWebProxy(); Proxya.Credentials
Hey guys i have another question about dojo. This time it has to do
I'm trying to implement this example http://jsfiddle.net/gzF6w/1/ (from another question here on stak) on
Yes, I know, yet another question about mutable objects. See this for general background
This question arose when I was working on answering another question about best practices
This question originated when I came upon ( another thread ) about Python's datetime
This question follows another, just solved here Now I want to do a different
Ok, so here is another question on basics of Casbah and MongoDB. After I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.