Jump to content
Mark Whitmore

Reducing YouTube embedding size

Recommended Posts

I've found the following method which reduces the JS load (almost 1.1mb) needed by the media player when a YouTube video is embedded on a listing page: https://www.labnol.org/internet/light-youtube-embeds/27941/

This method replaces the player with a thumbnail and only loads the player when the thumbnail is clicked. This will be hugely beneficial to load times in my opinion. 

Could anyone walk me through how to install this? I've attempted to do this but I cannot find mention of the player in any .thtml files. Alejandro, any plans to implement this in future versions?

Share this post

Link to post

That looks pretty cool and I will add it to tasks to be looked into in future updates. I have to provide solutions that work across the board and that means all video providers that currently work with JReviews and not all of them will provide you with the image through a straightforward URL that includes the video id. Right now if you use the video lightbox layouts then the iframe doesn't load until you click on the thumbnails. 

The code for the video providers is here /components/com_jreviews/jreviews/services/storage, one separate file for each one. And inside you'll find the function displayVideo which gives you the $videoId you need.

Share this post

Link to post


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Please refer to our Privacy Policy.