NitroPack and YouTube: How to Replace Youtube iframe With Preview Image

By default, our service automatically detects YouTube iframes and changes their iframe tag to img. Once a visitor clicks on the video’s thumbnail, the iframe tag will be loaded, and the video will be played.
This feature is part of our “Automatic Image Lazy Loading” set of features.


Known issues

  • Sometimes, the thumbnail quality may be a bit blurry. 
  • Rarely, the thumbnail may not be the original used by the video but a snapshot of the video taken by our service.
  • The iframe element may flash upon clicking.
  • The iframe element may not visibly load (meaning the element exists but remains invisible).

How to tackle any related issues?

The best approach here will be to set the Lazy iframes to “Disabled” and refresh your cache.

This can be done via the Cache Status tab of the NitroPack Dashboard:


This way, our service will no longer modify the YouTube iframes to images, and the video will be freshly served to originate from an external source.

📌 If you need any assistance or have questions, reach out to our support team at or via this link:

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.