• As Lazy Load for Videos has issues with various page builders—Divi, Elementor, etc.—perhaps a good way to work around that would be a way to exclude videos within containers of a certain class.

    For instance it’s be nice to be able to exclude all videos in the class ‘et_pb_video‘, which is the class of the Divi video module—which Lazy Load Videos currently breaks.

    This would allow one to use Lazy Load Videos within a Divi text module, and regular Blog Posts and Pages that don’t use Divi, but not interfere with Divi’s own lazy load used for its own video modules.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author kevinweber

    (@kevinweber)

    Hi @mpmchugh,
    I agree that it would be nice to ensure compatibility between Lazy Load for Videos and those page builders. I suppose you’re referring to the CSS class “et_pb_video”, and I’m not sure if it’s as easy to ensure compatibility as checking for that class.

    It really depends on the type of conflict between the page builder and the video plugin. Lazy Load for Videos modifies the original video embed code that is being rendered on the server (in PHP) even before JavaScript and CSS is running in the browser. It might be necessary to prevent this from happening on sites with the page builder, or maybe there’s something that’s better changed within the page builder as opposed to within the video plugin’s codebase.

    Either way, I can’t really develop for those use cases because I don’t have access to those page builders and given that this is a free plugin, I’d encourage you to reach out to those page builder developers instead. In the end, those are paid solutions and the teams behind them are being paid to make you happy with their solution, so why not let them fix the conflict? Alternatively, anyone who has access to both the page builder code and the video plugin can contribute.

    It’s easy to contribute to the Lazy Load for Videos plugin; all the code is open source and free. Contributions can be submitted on Github and I’m happy to review and publish changes, as I’ve done for several pull requests before: https://github.com/kevinweber/lazy-load-for-videos

    Thread Starter mpmchugh

    (@mpmchugh)

    Hi Kevin,
    Thanks for the reply. I’ll certainly reach out to Elegant Themes, the Divi developers, but it seems Lazy Load for Videos is doing something very low level that would be difficult for them to work around. And then it would have to be dealt with individually by all the the other page builders as well—Elementor, WP Bakery, etc.

    I suggested the “by enclosing class” possibility, as there are other similar plugins that have such an option. Lazy Load for Videos seems to be the best at what it does, so I was just making the suggestion to improve it’s compatibility for more users.

    It also might be worth considering making your plugin optionally use its own shortcode-—e.g. [lazy-video src=””] or something like that—-to only lazy load videos using the Lazy Load for Videos shortcode.

    This would allow much wider compatibility, as it optionally wouldn’t be globally applied, and the user could use it as needed. i.e. people using page builders could just use the shortcode on their blog posts and none builder-built pages, for instance.

    Another option to consider is a per page/post control that enables or disables Lazy Load for Videos for that page or post. A lot of caching plugins have options to disable their features on a per-page/post basis.

    Either of these would make Lazy Load for Videos a lot more compatible with people’s specific site setups, themes and other plugins.

    Thanks,
    Michael

    Plugin Author kevinweber

    (@kevinweber)

    Those are all good ideas. I’m definitely open to make a change within the video plugin; it would just be extremely helpful if those builder/theme developers can make a PR with solution – for the reasons mentioned. Let’s come back to this once you’ve heard from them.

    Thread Starter mpmchugh

    (@mpmchugh)

    Sorry, but what do you mean by “make a PR with solution”? Not clear with “PR” refers to here.

    Plugin Author kevinweber

    (@kevinweber)

    @mpmchugh PR in the context of open source development stands for Pull Request, a way to contribute code. All of the plugin’s code is on Github where contributions can be made: https://github.com/kevinweber/lazy-load-for-videos/pulls

    • This reply was modified 3 years, 6 months ago by kevinweber.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Suggestion: a way to exclude videos from lazy loading by enclosing class name’ is closed to new replies.