I would like to insert a youtube video and play it right away, I am not quite sure how to get this to work with jquery on live click. Any ideas?
var youTubeVideo = '<object width="370" height="260"><param name="movie"' +
' value="http://www.youtube.com/v/[ID]&amp;hl=en_US&amp;fs=1?rel=0enablejsapi=1&playerapiid=player"></param>' +
'<param name="allowFullScreen" value="false"></param><param name="allowscriptaccess"' +
'value="always"></param><embed src="http://www.youtube.com/v/[ID]&amp;hl=en_US&amp;fs=1?rel=0enablejsapi=1&playerapiid=player"' +
'type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false"' +
'width="370" height="260"></embed></object>';
$('#MyVideo').live('click',function () {
$(this).append(youTubeVideoHTML);
//How do you accomplish this call?
//player.playVideo();
});
I have to do this on a click of a seperate element so starting the play right away is not an option. I would also prefer to not use any external api's.