×
WYSIWYG editor in Kunena (forum) (14 Jan 2021)

I have upgraded Kunena and we are now using the build-in wysiwyg ck-editor.
If you have issues posting on my forum please contact me via the contact page.

Research JCHoptimize of iframes thwarts ochFitvids

  • Tim Davis
  • Tim Davis's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 weeks 3 days ago - 3 weeks 3 days ago #1482 by Tim Davis
Hi Ruud,

I have discovered that when JCHoptimize is set to lazy load iframes, och Fitvids does not work. Just letting you know.

Here is a sample iframe code with JCH lazyload fingerprints on it:
<div class="responsive-video"><iframe class="jch-lazyload" src="about:blank" data-src="https://www.youtube.com/embed/e9yE7ZyNUDs" width="560" height="315" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
Last edit: 3 weeks 3 days ago by Tim Davis.

Please Log in or Create an account to join the conversation.

More
3 weeks 2 days ago #1484 by Ruud van Lent
Replied by Ruud van Lent on topic JCHoptimize of iframes thwarts ochFitvids
Hi Tim,
JCH is known (at least for me) to rule the web as they are the only extension installed. When there are issues with extensions / plugins first question i ask is always is JCH Optimize installed: if yes, turn it off and see if that fixes the issue.

That said: What I see in the iframe code you provided, JCH is using a very 'old fashioned' lazyloading via a javascript. There are currently lazy loading standards introduced in all (modern) browsers that do not break the web.

JCH Optimize breaks the iframe by removing the src attribute. by doing that the iFrame cannot load because there is nothing to load. When the broken iFrame comes into to view, JCH repairs the iFrame by re-adding the src attribute.

Long ago, that was a very tricky lazy loading implementation. Since then the world has moved on and lazy loading is now a browser standard. You can simply add the loading="lazy" attribute to any iFrame and the browser will handle it as such.
like this:
<iframe src="video-player.html" title="..." loading="lazy"></iframe>

ochFitVids requires a intact iFrame as a broken iFrame is no iFrame :)

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago #1488 by Ruud van Lent
Replied by Ruud van Lent on topic JCHoptimize of iframes thwarts ochFitvids
Maybe I can have ochFitVids set the loading='lazy' element on iFrames it finds and processes. That way you have optimum sized videos AND lay loading conform latest standards (which Google likes as this is a standard I believe they introduced, or took part in).

Please Log in or Create an account to join the conversation.


End of content

No more pages to load

Log In or Sign Up

Forgot your password? / Forgot your username?