Smart Youtube Video Link Parser - jQuery yt-links-parser

Smart Youtube Video Link Parser - jQuery yt-links-parser
File Size: 8.04 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

yt-links-parser is a jQuery plugin that parses the Youtube links within your web content and embeds the corresponding video player in your document.

How to use it:

1. Load the required JavaScript and CSS files in your html document as follow:

<link rel="stylesheet" href="yt-links-parser.css">
<script src="jquery.min.js"></script>
<script src="yt-links-parser.js"></script>

2. To embed an Youtube video into the document, just copy and paste the video link into the webpage where needed.

<div>
  <p>Paragraph https://www.youtube.com/watch?v=RDQmnzuE2q4</p>
  <p>Paragraph www.youtube.com/watch?v=RDQmnzuE2q4</p>
</div>

3. If you want to specify the height/width of the Youtube video player.

<div data-yt-width="640" 
     data-yt-height="480">
     <p>http://youtu.be/KV4Rg2UFN0o</p>
</div>

4. Initialize the plugin and you're done.

$('div').ytLinksParse();

5. If you want to replace the Youtube links with Youtube thumbnails that will autoplay when clicked:

$('div').ytLinksParseToImage();

6. Apply darken & zoom effects to the Youtube thumbnails.

$('div').ytLinksParseToImage({
  darken: true,
  zoom: true
});

Change log:

2017-08-09

  • fix search regexp

This awesome jQuery plugin is developed by firesoft. For more Advanced Usages, please check the demo page or visit the official website.