Lazy Load Iframes video show image#1000
Draft
timotei-litespeed wants to merge 1 commit into
Draft
Conversation
Add functionality - Video Lazyload Add filter for play button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Load Video Image
Adds a new Load Video Image option (Page Optimization → Media Settings) that replaces YouTube / Vimeo / Wistia / Dailymotion
<iframe>s with a thumbnail + play-button facade. Click on image reconstructs a fresh iframe with autoplay.Behavior
O_MEDIA_IFRAME_LAZY_VIDEO_IMG(default off), gated on Lazy Load Iframes.Media::_finalize()runs the facade pass before the existing iframe-lazy pass — video iframes become<div>s, non-video iframes still getdata-srctreatment.src; lazy data-attrs, excluded class;autoplay=1\|truein query, URL filter, unknown provider, dup markup.Facade markup
No
<iframe>in server HTML. Facade script carriesdata-no-optimize="1"so JS Delay won't defer it.Filters
litespeed_video_lazy_providers,litespeed_video_lazy_skip_urls,litespeed_video_lazy_skip,litespeed_video_lazy_thumbnail,litespeed_video_lazy_facade_html. Reuses existing class-exclude filters.Limitations
<noscript>fallback — JS off = no playback.<iframe />and JS-driven autoplay aren't detected.Testing
Enable both toggles, drop YouTube / YouTube-autoplay / Vimeo / Wistia / Dailymotion / class-excluded iframes into a page. Verify facades render, autoplay iframes pass through, click swaps in a working iframe.