Add a featured video mode to the front page hero
A fourth hero mode beside brand, photos and livestream: a recorded video next to the words, under a "Featured video · <title>" badge. Unlike the livestream it never autoplays: an embed waits for play, and a file shows the browser's own player with preload="metadata". video_url takes a YouTube, Vimeo or Facebook link (turned into an embed, as the livestream's is) or a video file: a filename in public/front-page/, a /path, or an https URL ending in .mp4, .webm, .m4v, .mov or .ogv. Anything else that can't be framed still gets a "Watch the video" button. Files follow the embeds' https-only rule. Its own video_url and video_title columns rather than the livestream's, so both can be set up ahead of time and the mode switches between them. Migration 024 rebuilds front_page for the wider hero_mode CHECK; its children, keys and touch trigger survive. embeds.ts gains an autoplay switch shared by both modes, and videoSource() to tell a file from an embed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b10a263a90
commit
8c26ec4906
8 changed files with 243 additions and 22 deletions
|
|
@ -35,6 +35,10 @@ export const awardLogo = inDir('/award-logos') // ⚠ guess
|
|||
the Front page editor, which names the directory in its help. */
|
||||
export const heroPhoto = inDir('/front-page')
|
||||
|
||||
/* front_page.video_url when it names a file rather than a link:
|
||||
same directory as the photos. */
|
||||
export const heroVideo = inDir('/front-page')
|
||||
|
||||
/* content_blocks.media, which can be an image on any owner's page,
|
||||
so it can't share a per-entity directory. */
|
||||
export const blockMedia = inDir('/media') // ⚠ guess
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue