Page 1 of 1

Plugin for faster YouTube embeds

Posted: Sun Jun 06, 2021 9:01 am
by onli
serendipity_event_lazyoutube is a plugin that transforms the iframe usually used to embed a Youtube video.

The regular Youtube iframes load and run a lot of Javascript code on page load. This is a real problem for site performance as soon as more than one or two are on a page, which easily happens on the frontpage of our blogs. By replacing the default iframe with an iframe that only shows a preview image at first and then loads the player after a click, Youtube embeds stop being a performance problem. This plugin does that transformation automatically when it detects the standard Youtube iframe code.

https://www.onli-blogging.de/2040/YouTu ... lugin.html has some more explanation (in german) and shows an example.

It is not on spartacus yet, but has its own Github repo at https://github.com/onli/serendipity_event_lazyoutube. If you'd like to use that plugin, download the code and place it in your s9y blog under plugins/serendipity_event_lazyoutube. Then you can install it in the plugin installation menu (search either for serendipity_event_lazyoutube or for the title, currently "Markup: Lazy YouTube Embeds").

Re: Plugin for faster YouTube embeds

Posted: Thu Jul 01, 2021 10:24 pm
by onli
For what it's worth: It continues to work in my blog, and I see it as finished. But sure, more tests would be nice.