Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, so here's the answer found in one tiny line of text on the API page: <a href="http://code.google.com/apis/youtube/js_api_reference.html" rel="noreferrer">http://code.google.com/apis/youtube/js_api_reference.html</a></p> <blockquote> <p>"Note: To test any of these calls, you must have your file running on a webserver, as the Flash player restricts calls <strong>between local files</strong> and the internet."</p> </blockquote> <p>So to allow me to continue to develop on my Mac laptop I did the following:</p> <ol> <li><p>Edited my <strong>/etc/hosts</strong> file to include an entry back to my localhost:</p> <pre><code>127.0.0.1 testhost.com </code></pre></li> <li><p>Edited my <strong>/etc/apache2/httpd.conf</strong> file to add a virtual host entry pointing back to my development directory:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName testhost.com DocumentRoot /Users/amy/flashproj &lt;Directory /Users/amy/flashproj&gt; AllowOverride all Options MultiViews Indexes FollowSymLinks Allow from All &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre></li> <li><p>Restarted Apache:</p> <pre><code>sudo apachectl restart </code></pre></li> <li><p>Browsed back to my own localhost via my new virtual server:</p> <pre><code>http://testhost.com </code></pre></li> </ol> <p>Voila. That totally works now. I can query the page for the player:</p> <pre><code>document.getElementById('e1'); // OK document.getElementById('e1').playVideo(); // OK! </code></pre> <p>Whew! No <em>onYouTubePlayerReady()</em> required either!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload