Repository navigation
feat(video): update video block - #237
Draft
marissahuysentruyt wants to merge 8 commits into
Draft
marissahuysentruyt wants to merge 8 commits into
marissahuysentruyt wants to merge 8 commits into
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
- the youtube block embedded a third-party iframe as soon as it scrolled into view, so every video cost a full player download whether or not anyone pressed play; the video block shows a poster and builds the iframe only on activation - read the video id strictly instead of trusting the last path segment, so shorts and live URLs resolve and an unplayable URL is dropped rather than embedded broken - name the play control and the player from the provider's own title, since every embed previously shared the title "Youtube Video" - support Adobe Video Publishing Cloud alongside YouTube, because videos are authored as links in DA from either provider - accept a table contract as well as a link, so authors can supply a transcript or a custom poster, neither of which a bare link expresses - move the authored-cell readers into scripts/utils/cells.js, since the table contract is the first thing here that needs them
- two tests awaited `new Promise(requestAnimationFrame)` to let pending work settle before asserting that nothing further changed - the full concurrent suite runs test pages hidden, and a hidden page fires no animation frames, so that await never resolved and took the whole file past the runner's 120s limit instead of failing - wait on a timer instead, which still flushes the microtasks and the MutationObserver callback these assertions depend on - every other wait in the file already rejects after 2s, so these were the only two that could hang rather than fail
- pages with video need one small play/pause control and no scrubber, quality menu or fullscreen button, none of which a provider iframe can offer, so short clips need a native player - the control is built here rather than taken from the browser, since `<video controls>` cannot be reduced to a single button - `usage` will render video in its panels too, so the player lives in `scripts/utils/` rather than in either block; no block imports another - the stylesheet loads on demand, so a page without video never asks for it - the control reads the media events rather than its own click, so its name stays accurate when something else starts or stops playback, and a rejected `play()` leaves it ready to retry instead of out of step - sizing is left to the consumer, which owns its own frame
- the key/value rows came from the block this was ported from; Spectrum Hub authors blocks by writing content in place, the way `columns` and `usage` read theirs, so the contract now follows the content - route an uploaded MP4 to the player added in the previous commit, since the pages with video need one small control rather than a provider's full chrome; YouTube and Adobe links still hand off to their own players - take the video's name from the link text, or from the alt of a poster the link wraps, so the name an author already writes is what a screen reader announces and there is no separate field to forget - read whatever follows the media as a caption, which is where the authored explanation belongs now that the transcript row is gone - normalize an authored `16-9` to `aspect-16-9`, since a CSS selector cannot start with a digit, and fall back to widescreen for an unknown ratio rather than matching no rule at all - cap width per size class against the `columns` scale, so a large player still shrinks on a phone instead of holding its mock dimensions - drop `getAuthoredCells` and `getCellLinkHref`, which lost their only consumer with the key/value rows
- motion guidance compares a recommended clip against one to avoid, which is what `usage` already does for images, so it learns video rather than the video block growing a comparison variant - a link to a video file in the media cell becomes a player; any other link is passed through untouched, so existing panels are unaffected - the indicator, caption and panel layout are unchanged, since only what fills the media cell differs - move `isVideoFile`, `getVideoTitle` and the new `buildPlayerFromLink` into the shared player module: both blocks need them and no block in this repository imports another - a panel frames its video 16:9, because the shared player leaves sizing to whatever hosts it
- drive real Tab, Enter and Space against the control: focus lands on it and moves off, activation flips the name between play and pause, and focus stays put through both - back the fixture with a canvas stream, so the element genuinely plays and pauses without committing a binary; an empty source would reject play() and never fire the event the control listens for - cover the player on its own as well as through a block, since both `video` and `usage` inherit this control and neither owns it
- an uploaded MP4 pasted on its own line rendered as a plain link, because the only auto-block patterns were the three providers; match `.mp4` so the self-hosted player is reachable the way a YouTube link already is - match the extension rather than a path: every DA asset shares the /media/ prefix, so a path pattern would catch linked images and PDFs as well - hand back an auto-blocked link that holds no playable video instead of removing it. The pattern is a guess made from a URL, and a YouTube channel or playlist matches it as readily as a video does, so a link an author pasted could disappear from the page with only a console line to explain it - an authored block still goes when its URL is unplayable, because that author asked for a video and an empty frame is worse than nothing
- adding the `.mp4` pattern made the auto-block match links inside authored video and usage blocks, which are that block's own content - a section's link blocks load before its blocks, so the link was consumed first and the block was left with an empty cell to read; it then found no video and removed itself, taking the player and the author's size and ratio with it - recognize a link an owning block already holds and step aside, handing the link back untouched so the block reads it a moment later - mirror the real load order in the fixture: both lists are collected before anything loads, so a div a link block just created is not read as a block
marissahuysentruyt
force-pushed
the
block-youtube
branch
from
December 4, 2026 23:07
86308c0 to
a7a5f6e
Compare
This branch was successfully deployed
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.
Description
Screenshots (if applicable)
Type of change
Related issue(s)
Validation steps
To Validate
URL for testing:
https://--spectrum-hub--adobe.aem.live/
npm testand confirm all tests passnpm run lintand confirm no linting errorsaem upAccessibility testing checklist
Device review
Checklist: