Youtube Video Autoplay In Popup – jQuery GRT

File Size:20.07 KB
Views Total:358
Last Update:December 23, 2017
Publish Date:December 2, 2017
Official Website:Go to website
License:MIT

A youtube video open in popup/light box with jquery plugin. this jquery plugin support for popup open in youtube video play with autoplay or manual play. when you close popup with close youtube video. YouTube video inside a responsive modal window.

How to use it:

1. Add Youtube js/css link :

<link rel="stylesheet" href="grt-youtube-popup.css">
<!-- Jquery -->
<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>

<!-- GRT Youtube Popup -->
<script src="grt-youtube-popup.js"></script>

2. Html Popup open :

<!-- inline element -->
<span class="youtube-link" youtubeid="WZhJoRxWcLE">Open Video</span>

<!-- a link -->
<a href="#" class="youtube-link" youtubeid="-fac_iJ8Nw8">Open Video</a>

3. Plugin function :

$(".youtube-link").grtyoutube({
  autoPlay:true,
  theme: "dark" // or dark

});

Done 🙂