//Jquery playing youtube vedioes
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> // include jquery js
<link type="text/css"
href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css" rel="stylesheet" /> // include jquery css file
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script> // include ui js file
<script language="javascript" src="jquery.youtubepopup.min.js" > // include popup window is
</script>
<script>
$(document).ready(function() {
$("#4eYSpIz2FjU").live("click", function(){
$("img.youtube").YouTubePopup({youtubeId: '4eYSpIz2FjU', title: 'My New Title' }).click();// we will be passing our youtube id
});
});
</script>
<img class="youtube" id="4eYSpIz2FjU" src="https://img.youtube.com/vi/4eYSpIz2FjU/1.jpg" title="..."/> //on clicking of image the vedio will start playing
No comments:
Post a Comment