jquery.mb.ytplayer
Version:
This plugin let you play any public YouTube video as background of your page. It can also be used as a customized player in page.
32 lines (25 loc) • 1.08 kB
HTML
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
jquery.mb.components
file: ajaxVideo.html
last modified: 10/25/18 8:00 PM
Version: {{ version }}
Build: {{ buildnum }}
Open Lab s.r.l., Florence - Italy
email: matteo@open-lab.com
blog: http://pupunzi.open-lab.com
site: http://pupunzi.com
http://open-lab.com
Licences: MIT, GPL
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
Copyright (c) 2001-2018. Matteo Bicocchi (Pupunzi)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<div class="player" id="videoFragment" data-property="{videoURL:'BsekcY04xvQ',containment:'self',autoPlay:true, mute:true, startAt:0, opacity:1}"></div>
<script>
//Change the ID of the video placeholder to let the YT API work on multiple calls
var ID = "videoFragment" + new Date().getTime();
var el = jQuery("#videoFragment").get(0);
jQuery("#videoFragment").attr("id", ID);
// Init the video
jQuery("#"+ID).mb_YTPlayer();
</script>