playing videos with html5 on android device
<p>I'm building a mobile site and I'm having trouble playing video on android devices. I can get the video to play but find it erratic. Sometimes it causes the browser to crash, other times the controls aren't responsive. Most of my testing is on the Galaxy S3 and Nexus. </p>

<p>The code is a link that you can click to play the video.</p>

<pre><code>&lt;div id="player"&gt;&lt;/div&gt;
&lt;a href="#" onclick="DoNav('&lt;?php echo $url; ?&gt;');" title="Click to play video"&gt; &lt;?php echo $result_videos[$i]["camera_name"]; ?&gt; &lt;/a&gt;
</code></pre>

<p>The javascript/jquery mix (not very optimal, so maybe this is the problem):</p>

<pre><code>function DoNav(theUrl)
{

// only add the player if it doesn't yet exist
if($('#myfileplayer').length == 0) {
    var mydiv = $("#player");
        var myvideo = $("&lt;video id='myfileplayer' src='"+ theUrl + "' width='320' height='240' controls&gt;&lt;/video&gt;");
           mydiv.append(myvideo);
} else {
   $('#myfileplayer').attr("src",theUrl); 
}

var video = document.getElementById('myfileplayer');
video.addEventListener('click',function(){
  video.play();
},false);

} 
</code></pre>

<p>I'm not sure what else to debug here. Any ideas?</p>
