title: Youku JS API - Play / Pause methods and events
body: <p>I'm trying to add YouKu functionality to a site, to sit alongside other videos in a gallery. </p>
  
  <p>I'm using the documentation I've found at <a href="https://cloud.youku.com/docs" rel="noreferrer">https://cloud.youku.com/docs</a> and <a href="https://cloud.youku.com/tools" rel="noreferrer">https://cloud.youku.com/tools</a> (I've been relying on Google Translate as my understanding of the Chinese language is non-existent!)</p>
  
  <p>This second link suggests a snippet like so:</p>
  
  <pre><code>&lt;div id="youkuplayer" style="width:480px;height:400px"&gt;&lt;/div&gt;
  &lt;script type="text/javascript" src="//player.youku.com/jsapi"&gt;&lt;/script&gt;
  
  var player = new YKU.Player('youkuplayer',{
    styleid: '0',
    client_id: 'MY_CLIENT_ID',
    vid: 'XMzA2ODI5MjAwNA==',
    newPlayer: true 
  });
  
  function pauseVideo() {
    player.pauseVideo();
  }
  </code></pre>
  
  <p>However, the <code>pauseVideo</code> method doesn't work, throwing a <code>Cannot read property 'pauseVideo' of null"</code> error</p>
  
  <p>In other docs I've found an <code>events</code> parameter but this isn't working for me either.</p>
  
  <p>Has anyone had any experience with programmatically controlling YouKu videos? </p>