Skills for building AEM Edge Delivery Services sites — block development, content modeling, code review, testing, and page import.
82
76%
Does it follow best practices?
Impact
88%
1.04xAverage score across 6 eval scenarios
Advisory
Suggest reviewing before use
The editorial team at GlobalMedia Group wants to embed YouTube videos on multiple pages of their AEM Edge Delivery Services website. Video embeds are known to be a major source of page performance degradation — loading the YouTube iframe API and player code eagerly means the video player JavaScript starts executing before the user even scrolls to it, hurting Largest Contentful Paint (LCP) scores and Core Web Vitals.
The team needs a video-embed block that shows a static thumbnail image with a play button overlay as the initial state. The actual YouTube player should only be loaded and initialized when a user scrolls the block into the visible viewport. The block should support being placed anywhere on the page — including above the fold in hero sections — but must prioritize page performance in all cases by deferring the YouTube API load until it is needed. Authors will add the block to pages by putting the YouTube video URL in a simple one-cell table in Google Docs.
Create a complete, working implementation of the video-embed block including:
The implementation should:
https://img.youtube.com/vi/{videoId}/hqdefault.jpgDo not include the YouTube iframe API <script> tag in your HTML — load it dynamically from JavaScript when needed.
The following files are provided as inputs. Extract them before beginning.
=============== FILE: inputs/sample-block-content.html ===============
<!-- This shows the DOM structure the AEM platform delivers to the decorate() function. The block receives one div child containing the authored YouTube URL as a paragraph. --> <div class="video-embed"> <div> <div> <p>https://www.youtube.com/watch?v=dQw4w9WgXcQ</p> </div> </div> </div>evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
skills
analyze-and-plan
block-collection-and-party
block-inventory
building-blocks
code-review
content-driven-development
content-modeling
docs-search
find-test-content
generate-import-html
identify-page-structure
page-decomposition
page-import
preview-import
scrape-webpage
testing-blocks