title: Youtube player API in Chrome extension
body: <p>I'm looking to use the Youtube player API in my Youtube Chrome extension.<br>
  My goal is to be able to control the player's controls on Youtube website from my content script using the pageAction's popup.  </p>
  
  <p>It goes like this -<br>
  Clicking on a "play" button in the popup sends a message to the content script, the content script receives the message and use the player API event "playVideo()" to play the video.  </p>
  
  <p>Because of the content script and the page itself are isolated from each other then I can't simply get the player's object from the page, and from what I understand I can't use messages to send an object over from the page to the content script.  </p>
  
  <p>Now I could bypass all this trouble by using the HTML5 video events, but unfortunately this won't work on live streams since flash is still in use there, so I kind of have no other choice but loading and using the player API, am I correct?<br>
  Is there a way to control the player using URL parameters on Youtube site itself?<br>
  (I really prefer everything than loading an additional script and external one)</p>
  
  <p>Where it comes to code I would like to get help setting the permissions needed to be able to load the external script please.<br>
  I saw that there is a need to declare a <code>content_security_policy</code> in the <code>manifest</code> file, but I do not understand the syntax and how to write it down, so I would like to have an example and whatever else is needed for it please.  </p>
  
  <p>In my content script I'm using the next code taken from the YT player API documentation to inject the script:</p>
  
  <pre><code>var tag = document.createElement('script');
  tag.src = "https://www.youtube.com/iframe_api";
  var firstScriptTag = document.getElementsByTagName('script')[0];
  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  
  function onYouTubeIframeAPIReady() {
      console.log('--- The YT player API is ready from content script! ---');
  }
  </code></pre>