jquery plugin for embedding youtube video with lazy loading approach
- It only loads one video image from youtube and renders a play button on it.
- Once user clicks on the play button, video is loaded.
- For fancier button, you can change the javascript code accordingly
<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/jquery.embedyt.js"></script>
<div id="youtubeembed" youid="youtubevideoid"></div>
jQuery(function () {
jQuery("div.youtubeembed").each(function (index) {
jQuery(this).embedyt(jQuery(this).attr('youid'));
});
});