title: JQuery autoplay video
body: <p>Hi I have some very basic html for a video:</p>
  
  <pre><code>&lt;div class="video_holder"&gt;
        &lt;video id="video_player" controls="controls" poster=""&gt; 
          &lt;source id="video_mp4" src="" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /&gt;
        &lt;/video&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>in my js:</p>
  
  <pre><code> function playFile(e) {
        ...
        e.preventDefault()
        var selected = $(this);
        var path = selected.attr('href');
        $("#video_mp4").attr('src', path);
        // how do I get this thing to auto-play?????
    };
  </code></pre>
  
  <p>This works great for injecting the correct path into the <code>src</code> attribute, and I have verified the path is correct and accessible. However, I cannot get the video to autoplay on load.</p>
  
  <p>I have tried:</p>
  
  <pre><code>document.getElementById("video_player").play();
  
  $('#video_player').trigger('play');
  
  $('#video_player').play();
  </code></pre>
  
  <p>How can I trigger the video to autoplay?</p>
  
  <p>Any help much appreciated.</p>