The goal of this plugin is two-fold:
- Make pages with YouTube embed load faster, thereby improving user-experience and pagespeed scores.
- Give you more options when embedding YouTube iframes into your pages
How it works
It is simply a shortcode with lots of options. You embed a shortcode in into your page (or text/shortcode element in your pagebuilder). Like so:
You can specify a size in pixels like this:
[yif link=https://www.youtube.com/watch?v=_BTx23kraDc size=200x200]
You can specify a rounded border like this:
[yif link=https://www.youtube.com/watch?v=_BTx23kraDc size=200x200 rounded=1]
That will look like this…
If you want a video with the YouTube controls removed, that would be done like so:
[yif link=https://www.youtube.com/watch?v=_BTx23kraDc size=200x200 rounded=1 noc=1]
hide_controls work instead of the shortened
You can also start your embedded video at a particular timestamp.
[yif link=https://www.youtube.com/watch?v=_BTx23kraDc size=200x200 rounded=1 time=10m20s]Due to it’s length and uneventfulness, make the video full screen to see that the time did start at the right point.
If this looks like something you could use, please give it a try. It is available for all Ananda Centers sites to try. There are more options that I haven’t documented in this post. Instead I’ll make a follow-up post if there is any interest. Since it is a work-in-progress, any feedback is welcome in the comments.