ACT metube
Embed youtube videos without slowing down your page.
When you embed a youtube video on your page, the youtube apis are loaded during your page load and this is slowing down your page’s first response and drops your performance scores making your page look worst SEO-wise.
With ACT metube you can avoid this happening. You embed your video by giving a div a class named A-metube-[youtubeid]. After your page is loaded, ACT me tube is getting the youtube screenshot of your video and displays it in your container. When you click on the screenshot, the video starts playing.
This way, you avoid loading the youtube apis and your page loads faster and gets better performance scores.
Usage
Use it without parameters, or define the position and appearance of the arrow.
<div class="A-metube-lf8d0bXO2XI"></div>
<script type="text/javascript" src="ACT_metube.js"></script>
Youtube has the following resolutions for video screenshots:
- mqdefault (medium quality)
- hqdefault (high quality)
- sddefault (standard quality)
- maxresdefault (max quality)
Unfortunatelly not all videos support all resolutions. ACT metube tries to load the sddefault resolution which is the most possible to exist. However, if that resolution fails, you can provide another one in the class as follows:
<div class="A-metube-lf8d0bXO2XI::maxres"></div>