Repository navigation
feat(lab): add VideoPlayer and AudioPlayer media players - #9832
Conversation
Lab prototype of video and audio players whose themed controls drive the browser's native media element, with no new runtime dependency. - VideoPlayer: controls float in a frosted bar inset over the video; the bar shows on hover, pointer movement, and keyboard focus and hides after two idle seconds while the video plays. - AudioPlayer: title and artwork, timeline, skip back and forward, speed, mute, and system media controls. - MediaPlayer, the media and control parts, and useMediaPlayer for custom layouts. - Draft component spec with the owner decisions and open questions.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/AudioPlayer | 232.0 kB (new) · 1.8 kB CSS (new) | — | — · ✓ · ✗ |
| lab/MediaCaptionsButton | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
| lab/MediaFullscreenButton | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
9 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/MediaPlaybackRate | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
| lab/MediaPlayButton | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
| lab/MediaPlayer | 30.9 kB (new) · 165 B CSS (new) | — | — · ✓ · ✗ |
| lab/MediaPlayerElement | 6.9 kB (new) · 177 B CSS (new) | — | — · ✓ · ✗ |
| lab/MediaSeekButton | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
| lab/MediaTime | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
| lab/MediaTimeSlider | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
| lab/MediaVolume | 222.3 kB (new) · 1.5 kB CSS (new) | — | — · ✓ · ✗ |
| lab/VideoPlayer | 228.9 kB (new) · 2.0 kB CSS (new) | — | — · ✓ · ✗ |
Package size: @astryxdesign/cli 5.37 MB packed (+197 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
This pull request needs an engineering owner's spec decision before it can be approved, and it also needs changes.
Spec decision: no current spec governs the MediaPlayer family. Its only record, component:MediaPlayer, is a draft with seven open questions. An engineering owner records the decision on its requirements (FR1–FR10, AR1–AR7, DEC-1–DEC-7, DD1–DD2, including the timeline's left-to-right exception in OQ5) by commenting /approve-spec bfb5931d626aeb20bf6afc83a64fa9acffcc17fe; the author may do so if they are an engineering owner.
Required changes:
AudioPlayerclaims the system media session only on a player's first playback and releases it on unmount even after another player took it, so with two players the lock screen keeps the other episode and unmounting one clears the other's controls (AudioPlayer.tsx:199,:208).- The buffering
SpinnerinVideoPlayeris a liverole="status"inside the player, which the announcement spec (AST-086 FR8) rules out for an indicator inside its owner, so render it witharia-hidden="true"(VideoPlayer.tsx:223). MediaVolumeSliderpassesclassNameandstyletoSlider, which ignores them and warns on every render, so pass them ascontainerClassNameandcontainerStyle(MediaPlayerControls.tsx:235).- The root hands its element to the store from a layout Effect, so move that into a callback ref merged through
useMergedRefs, as the media parts already do (MediaPlayer.tsx:249). - A layout Effect only copies the playback callbacks into a ref, so list them as dependencies of the store-subscription Effect instead (
MediaPlayer.tsx:244). - The docs promise iOS Safari and iPhone behavior that no iOS run has shown, so attach that evidence or describe only the capability (
MediaPlayer.doc.mjs:375,:419). - At 4,386 authored lines with no size exemption, the change needs splitting, for example into the draft record, then the store and parts, then the presets, docs and stories.
[Automated review]
| }} | ||
| onClick={() => { | ||
| // A tap shows or hides the controls, the way native players do. | ||
| // A mouse click plays or pauses. |
There was a problem hiding this comment.
Non-blocking: this line narrates the else branch. The line above already gives the reason.
| try { | ||
| session.setActionHandler(action, null); | ||
| } catch { | ||
| // See above. |
There was a problem hiding this comment.
Non-blocking: "See above." is vague. Suggest: "Browsers that do not support an action throw."
The player's radius is now the bar's radius plus the bar's inset, so the two curves stay parallel in every theme. A square theme keeps both square.
There was a problem hiding this comment.
This pull request needs an engineering owner's spec decision before it can be approved, and it also needs changes.
Spec decision: no current spec governs the MediaPlayer family; its only record, component:MediaPlayer, is a draft with seven open questions. An engineering owner approves or rejects its requirements (FR1–FR10, including FR6's new rule that the player's corner radius equals the control bar's radius plus its inset, AR1–AR7, DEC-1–DEC-7, DD1–DD2, and the timeline's left-to-right exception that OQ5 leaves open) by commenting /approve-spec ce2afa9f231b0fdca8251ca221a9b5343bb9206a; the author may do so if they are an engineering owner.
Required changes:
- Miss: the docsite no longer builds, because the generated preview registry casts the
useMediaPlayerentry inMediaPlayer.doc.mjs:438to a component andnext buildfails type check with TS2352, so skip hook entries ingenerateComponentPreviewRegistry(apps/docsite/scripts/generate-data.mjs:1241) or keep the hook out of the doc'scomponentsuntil it does. AudioPlayerclaims the system media session only on a player's first playback and releases it on unmount even after another player took it, so with two players the lock screen keeps the other episode and unmounting one clears the other's controls (AudioPlayer.tsx:199,:208).- The buffering
SpinnerinVideoPlayeris a liverole="status"inside the player, which the announcement spec (AST-086 FR8) rules out for an indicator inside its owner, so render it witharia-hidden="true"(VideoPlayer.tsx:228). MediaVolumeSliderpassesclassNameandstyletoSlider, which ignores them and warns on every render, so pass them ascontainerClassNameandcontainerStyle(MediaPlayerControls.tsx:235).- The root hands its element to the store from a layout Effect, so move that into a callback ref merged through
useMergedRefs, as the media parts already do (MediaPlayer.tsx:248). - A layout Effect only copies the playback callbacks into a ref, so list them as dependencies of the store-subscription Effect instead (
MediaPlayer.tsx:243). - The docs promise iOS Safari and iPhone behavior that no iOS run has shown, so attach that evidence or describe only the capability (
MediaPlayer.doc.mjs:319,:375,:419). - At 4,391 authored lines with no size exemption, the change needs splitting, for example into the draft record, then the store and parts, then the presets, docs and story.
The other seven items were raised in the previous review and are unchanged; the new corner nesting renders as the record describes in the default, a rounder and a square theme.
[Automated review]
The bar now has the same padding on every side, so the buttons' corners nest inside the bar's. The frosted surfaces drop the low shadow, whose dark-mode inset ring read as an outline over video. The spec asks whether the bar should be a Toolbar.
There was a problem hiding this comment.
This pull request needs an engineering owner's spec decision before it can be approved, and it also needs changes.
Spec decision: no current spec governs the MediaPlayer family; its only record, component:MediaPlayer, is a draft with eight open questions. An engineering owner approves or rejects its requirements (FR1–FR10, AR1–AR7, PR1–PR2, DEC-1–DEC-7, DD1–DD2, including the timeline's left-to-right exception that OQ5 leaves open) by commenting /approve-spec 56c07e75fde26bc56087607c28da4450851d6e1b; the author may do so if they are an engineering owner.
Required changes:
- Miss: the docsite no longer builds, because the generated preview registry casts the
useMediaPlayerentry inMediaPlayer.doc.mjs:438to a component andnext buildfails type check with TS2352, so skip hook entries ingenerateComponentPreviewRegistry(apps/docsite/scripts/generate-data.mjs:1241) or keep the hook out of the doc'scomponentsuntil it does. AudioPlayerclaims the system media session only on a player's first playback and releases it on unmount even after another player took it, so with two players the lock screen keeps the other episode and unmounting one clears the other's controls (AudioPlayer.tsx:199,:208).- The buffering
SpinnerinVideoPlayeris a liverole="status"inside the player, which the announcement spec (AST-086 FR8) rules out for an indicator inside its owner, so render it witharia-hidden="true"(VideoPlayer.tsx:225). MediaVolumeSliderpassesclassNameandstyletoSlider, which ignores them and warns on every render, so pass them ascontainerClassNameandcontainerStyle(MediaPlayerControls.tsx:235).- The root hands its element to the store from a layout Effect, so move that into a callback ref merged through
useMergedRefs, as the media parts already do (MediaPlayer.tsx:248). - A layout Effect only copies the playback callbacks into a ref, so list them as dependencies of the store-subscription Effect instead (
MediaPlayer.tsx:243). - The docs promise iOS Safari and iPhone behavior that no iOS run has shown, so attach that evidence or describe only the capability (
MediaPlayer.doc.mjs:319,:375,:419). - At 4,394 authored lines with no size exemption, the change needs splitting, for example into the draft record, then the store and parts, then the presets, docs and story.
Every item above was raised in the previous review and is unchanged at this head; the new commit's even bar padding and dropped shadow render as described.
[Automated review]
… reveal Fixes from the component audit: - Focus moves to the player when the large play control or Try again leaves; the large play control is pointer-only. - The loading spinner stays out of the accessibility tree. - The bar's transition does not move under reduced motion. - VideoPlayer fills its container instead of collapsing to zero width. - Every part extends the base props and forwards DOM props; all theme targets are documented and the timeline's target is on its slider. - Docs name the APG patterns; every export has an example; Lab blocks give the docsite a showcase and examples; tests cover the callbacks, the hook, and keyboard use through user-event. Design changes: - The bar sits 8px from the edges, so the video's radius drops to 20px. - On touch, a tap shows the controls and the next tap hides them. - AudioPlayer uses a Section container instead of a card. - Playback speed is a menu; it shares one speed list with the shortcuts. - Both presets reveal the volume slider on hover or focus of Mute. - Glyphs resolve through media:* icon-registry keys; the neutral theme maps them to Lucide, and the bundled fallbacks are Lucide drawings.
- Captions sit above the control bar whether it shows or hides, so the bar never covers them and they do not jump. - The volume slider opens to the left of Mute with a gap, animates open and closed, and shows the volume in a tooltip; Mute stays under the pointer. - Skip controls use the rewind and fast-forward glyphs. - AudioPlayer pairs a speed button with a speed slider, revealed like volume. The button switches between normal speed and the last other speed. The speed menu stays available as a part.
…sual Five review stories: a ticker that replaces the control bar while it hides, the same ticker while buffering, chapter segments, comment pins over progress marks, and a feed clip whose only timeline is a ticker.
…e spec The volume group no longer shrinks in a tight bar, so the timeline gives up the space. The spec records that the slider's column opens with a short width transition under the disclosure exception, and stays still under reduced motion.
There was a problem hiding this comment.
This pull request needs an engineering owner's spec decision before it can be approved, and it also needs changes.
Spec decision: no current spec governs the MediaPlayer family. Its only record, component:MediaPlayer, is a draft, and the published neutral theme's new media:* glyph entries and widened neutralIconRegistry type have no record that covers them. An engineering owner (the author too, if they are one) records the decision by commenting /approve-spec 015f29540f8ae5ef2e134fc9d87199393e391667, or rejects it; that covers FR1–FR11, AR1–AR7, DEC-1–DEC-12, DD1–DD2, the timeline's relationship to the bidirectionality design record's DR6 (OQ5), and whether theme glyphs use media:* registry keys or typed component icon slots.
Required changes, whatever the decision:
- The docsite build fails because the generated preview registry casts the
useMediaPlayerdoc entry to a component (TS2352); skip hook entries in that registry or keep the hook out of the doc'scomponents. - Miss: after a mouse click or drag on the timeline the video controls never hide during playback, because the focused Slider thumb matches
:focus-visible; hold the controls for focus only after keyboard input. MediaVolumeSlider,MediaTimeSliderandMediaPlaybackRateSliderdropclassName,styleand their documented theme class, because Slider ignores root styling; pass them ascontainerClassNameandcontainerStyle.- The Effect at
MediaPlayer.tsx:279only copies callbacks into a ref; list the callbacks as dependencies of the subscription Effect and call them directly. - The caption-layout Effect in
VideoPlayer.tsxsets up listeners when the video and bar attach and never re-runs; move it to a callback ref or the store's track-list listener. - The volume and speed reveals repeat the container reveal's hover, focus and touch rules in their own grids; extend
useContainerRevealwith a collapsing width reveal and delete the copies. - The description and docs describe behavior the code does not have (a speed cycle, "no existing export changes", locally drawn icons, nine parts, 18 tests, seconds shown on the seek icon, a Menu Button speed control); correct those sentences.
- The docs promise iOS Safari and iPhone behavior with no iOS run; add iOS evidence or describe only the capability.
MediaTimelineExperiments.stories.tsxis an unrequested experiment; move it to its own pull request or drop it.- At 6,009 authored lines the change needs a split: the draft record, then the store, root and parts, then the presets with their docs and blocks, then the neutral theme glyphs.
The earlier Spinner, media-session and container-ref findings are fixed. The full review lists four non-blocking comment suggestions.
[Automated review]
| }} | ||
| onClick={() => { | ||
| // A tap shows or hides the controls, the way native players do. | ||
| // A mouse click plays or pauses. |
There was a problem hiding this comment.
Non-blocking: this line narrates the else branch; the line above already gives the reason.
| try { | ||
| session.setActionHandler(action, null); | ||
| } catch { | ||
| // See above. |
There was a problem hiding this comment.
Non-blocking: "See above." is vague. Suggest: "Browsers that do not support an action throw."
…twork and track controls - The timeline draws the buffered range, chapter segments, and marker dots on its own track. A pointer over it previews the time, the chapter, and the nearest marker, and its spoken value adds the chapter and a marker it reaches. The core Slider keeps the interaction and the focus ring. - VideoPlayer and AudioPlayer pass `chapters` and `markers` to it. - Mute and the speed button hold still while their sliders animate. - AudioPlayer shows artwork in front of the title: square by default, any aspect ratio, any media, or a generic audio file icon. - AudioPlayer offers previous and next track controls when the product passes handlers, and hands them to the system media controls. - Zero time is spoken as "0 seconds". - The timeline stories join the main media player group.
There was a problem hiding this comment.
This pull request needs an engineering owner's spec decision before it can be approved, and it also needs changes.
Spec decision: no current spec governs the MediaPlayer family. Its only record, component:MediaPlayer, is a draft, and the published neutral theme's new media:* glyph entries and widened neutralIconRegistry type have no record that covers them. An engineering owner (the author too, if they are one) records the decision by commenting /approve-spec efae0215a6fe294bfe23a92352114069fd0adcd1, or rejects it; that covers FR1–FR12 (including the new buffered range, chapters and markers), AR1–AR7, DEC-1–DEC-15, DD1–DD2, the timeline's relationship to the bidirectionality design record's DR6 (OQ5), and whether theme glyphs use media:* registry keys or typed component icon slots.
Required changes, whatever the decision:
- The timeline's
markersprop with{time, label}items names what Core's ProgressBar and Slider already callmarkswith{value, label}items; usemarks. - Keyboard and screen-reader users hear a timeline comment only when a 5-second step lands within 6 px of it, so on the story's own clip no comment is ever spoken; name the markers a step passes, or stop steps at markers.
- After autoplay, a mouse click on the timeline keeps the video controls up for the rest of playback, because the script-focused slider matches
:focus-visible; hold the controls for focus only after keyboard input. MediaVolumeSlider,MediaTimeSliderandMediaPlaybackRateSliderdropclassName,styleand their theme class and log a Slider warning on every preset render; pass them ascontainerClassNameandcontainerStyle.- The docsite build fails because the generated preview registry casts the
useMediaPlayerdoc entry to a component (TS2352); skip hook entries there or keep the hook out of the doc'scomponents. - The Effects at
MediaPlayer.tsx:279andAudioPlayer.tsx:273only copy props into refs; call the playback callbacks from the subscription Effect and set the media session's track handlers from an Effect keyed on them. - The caption-layout Effect in
VideoPlayer.tsxand the timeline-width Effect inMediaPlayerControls.tsxobserve elements from mount-only Effects; move each to a callback ref on its element. - The volume and speed reveals repeat the container reveal's hover, focus and touch rules; extend
useContainerRevealwith a collapsing width reveal and delete the copies. - The description, record and docs describe what the code does not do ("no existing export changes", chapters and markers as "no API" experiments, "nine control parts", seconds "shown on its icon", a Menu Button speed control) and give stale counts; correct those sentences.
- The docs promise iOS Safari and iPhone behavior with no iOS run; add iOS evidence or describe only the capability.
- At 6,580 authored lines the change needs a split: the draft record, then the store, root and parts, then the presets with their docs and blocks, then the timeline's chapters and markers, then the neutral theme glyphs.
The separate timeline experiments story file is gone. The full review lists five non-blocking comment suggestions.
[Automated review]
| /** Chapters, drawn as segments of the track with a small gap between them. */ | ||
| chapters?: readonly MediaTimelineChapter[]; | ||
| /** Points of interest, such as timestamped comments, drawn as dots. */ | ||
| markers?: readonly MediaTimelineMarker[]; |
There was a problem hiding this comment.
markers with {time, label} items names what Core already calls marks: ProgressBar takes marks?: ReadonlyArray<ProgressBarMark> ({value, label}) and Slider, which this timeline wraps, takes marks?: {value, label?}[]. Use marks with {value, label} items (or ProgressBarMark) so callers keep one word and shape.
| ] as const; | ||
|
|
||
| /** | ||
| * Hands the title, artwork, and transport actions to the system media |
There was a problem hiding this comment.
Non-blocking: this JSDoc describes useMediaSession but now sits on interface TrackHandlers. Move it below the interface.
| hasNextTrack ? () => trackHandlersRef.current.onNextTrack?.() : null, | ||
| ); | ||
| } catch { | ||
| // See above. |
There was a problem hiding this comment.
Non-blocking: "See above." is vague. Suggest: "Browsers that do not support an action throw."
- useMediaPlaybackTime advances the playback position on every animation frame while media plays, and snaps back on each time update, seek, pause, and stall; it follows the time updates only under reduced motion. The timeline uses it, so the playhead and fill glide. - A marker with `content` is a button: it jumps to its time and opens its content, such as a CommentThread, in a popover above the timeline. - The speed button and the speed menu keep one width at every speed. - Stories: comment markers open their comment threads, a controlless video shows only a thin progress line on hover, and feed clips show a thin segment per clip.
There was a problem hiding this comment.
This pull request needs an engineering owner's spec decision before it can be approved, and it also needs changes.
Spec decision: no current spec governs the MediaPlayer family. Its only record, component:MediaPlayer, is a draft that does not yet state this head's useMediaPlaybackTime hook or markers that open a popover, and the published neutral theme's new media:* glyph entries and widened neutralIconRegistry type have no record that covers them. An engineering owner (the author too, if they are one) records the decision by commenting /approve-spec 989aaa97adfabf231120c846e84174e5b770e836, or rejects it; that covers FR1–FR12, AR1–AR7, DEC-1–DEC-15, DD1–DD2, the timeline's relationship to the bidirectionality design record's DR6 (OQ5), whether the hook and pressable markers go into the record, and whether theme glyphs use media:* registry keys or typed component icon slots.
Required changes, whatever the decision:
- Arrow and Page keys typed in a timeline marker's popover seek the video instead of moving the caret, because the popover renders inside the wrapper that captures those keys; render the popovers outside it, or capture keys only on the slider thumb.
- The docsite does not build: the route lock lacks the new
useMediaPlaybackTimeroute, and the preview registry's cast ofuseMediaPlayerto a component fails with TS2352; refresh the lock and skip hook entries in the preview registry. - Keyboard and screen-reader users hear a marker without
contentonly when a 5-second step lands within 6 px of it; name the markers a step passes, or make every marker focusable. - After autoplay, a mouse click on the timeline keeps the video controls up for the rest of playback; hold the controls for focus only after keyboard input.
MediaVolumeSlider,MediaTimeSliderandMediaPlaybackRateSliderdropclassName,styleand their theme class and log a Slider warning on every preset render; pass them ascontainerClassNameandcontainerStyle.- The timeline's
markersprop with{time, label}items names what Core'sProgressBarandSlideralready callmarkswith{value, label}items; usemarks. useMediaPlaybackTimecopies the reported time into state in an Effect, so after a seek it renders the old position before repairing it; start the anchor in the frame Effect and derive the returned time during render.useMediaPlaybackTimereads the reduced-motion setting once withmatchMediainstead of Core'suseMediaQuery, so a change during playback is ignored; useuseMediaQuery.- The Effects at
MediaPlayer.tsx:279andAudioPlayer.tsx:273only copy props into refs; call the playback callbacks from the subscription Effect and set the media session's track handlers from an Effect keyed on them. - The caption-layout Effect in
VideoPlayer.tsxand the timeline-width Effect inMediaPlayerControls.tsxobserve elements from mount-only Effects; move each to a callback ref on its element. - The volume and speed reveals repeat the container reveal's hover, focus and touch rules; extend
useContainerRevealwith a collapsing width reveal and delete the copies. - The description, record and docs describe what the code does not do ("no existing export changes", chapters and comment pins as "no API" experiments, "nine control parts", seconds "shown on its icon", a Menu Button speed control) and give stale counts; correct those sentences.
- The docs promise iPhone and iOS Safari behavior with no iOS run; add iOS evidence or describe only the capability.
- At 6,842 authored lines the change needs a split: the draft record, then the store, root and parts, then the presets with their docs and blocks, then the timeline's chapters, markers and popovers, then the neutral theme glyphs.
[Automated review]
| return String(value).padStart(2, '0'); | ||
| } | ||
|
|
||
| /** Formats seconds as m:ss, or h:mm:ss when `hasHours` is true. */ |
There was a problem hiding this comment.
Non-blocking: this is formatClock's JSDoc, now stranded above useMediaPlaybackTime's. Move it back above formatClock.
…element radius - Captions move above the control bar as soon as their cues load, not only after playback starts: the player also listens for each track element's load event. - Marker dots sit on the center of the track. - A marker's popover takes the page's theme, so a comment thread keeps its usual card instead of the dark media surface. - The video takes the theme's element radius; the bar keeps the container radius.
…check - The swizzle proof renders each media part inside a player from the same copy, as it does for Tour steps and navigation screens. - Each media store probes once whether script can set the volume, so no module state outlives a store.
There was a problem hiding this comment.
Approval of this pull request waits on an engineering owner's spec decision at this head, and changes are required either way.
Spec decision: the draft component:MediaPlayer record (FR1–FR12, AR1–AR7, PR1–PR2, DEC-1–DEC-16, DD1–DD2) is the only record for this family, and the last /approve-spec names an earlier head. An engineering owner records the decision for this head by commenting /approve-spec 86a7bcc808603c6c28f539e07cdd64ec0c1120d7 on this pull request, which also settles whether MediaPlaybackRate keeps its variant name; the author may do so if they are an engineering owner.
Required changes:
- With focus on a button inside a comment marker's popover, ArrowRight, L and digits still seek the video and ArrowDown lowers the volume, because the root's shortcut handler skips only text fields (
MediaPlayer.tsx:338-345). - After autoplay, one mouse click on the timeline keeps the video controls visible for the rest of playback, because the root holds them for any
:focus-visiblefocus instead of asking Core's shared interaction modality (MediaPlayer.tsx:508-510). - Markers without
contentare spoken only when a 5 s or 10 s key step lands within 6 px of them, so keyboard and screen-reader users skip most of them (MediaPlayerControls.tsx:94). canScriptSetVolume()now runs insidereadAll, so every media event (about fourtimeupdates a second while playing) builds a throwaway<audio>element; probe once per store and reuse the result (mediaStore.ts:311).markerswith{time, label}names what Core'sSlideralready callsmarkswith{value, label}.useMediaPlaybackTimerenders the old time after a jump and repairs it in an Effect (MediaPlayerContext.ts:158-162).- Two element observers live in mount-only Effects instead of callback refs, so a replaced node is never observed (
VideoPlayer.tsx:306-394,MediaPlayerControls.tsx:774-782). - Reduced motion is read once through
matchMediainstead of Core'suseMediaQuery, and the slider reveal copies the container reveal's rules, already drifting from them (any-pointer: coarseagainst the sharedpointer: coarse), instead of extendinguseContainerReveal. MediaPlayerContextis still a plaincreateContext, so a swizzled part inside the package'sMediaPlayercannot read it; create it withcreateSharedContextfrom@astryxdesign/core/internal/shared-context(MediaPlayerContext.ts:62).MediaTimebuilds-0:30and0:12 / 1:00from literals, so no locale can change the minus sign or separator (MediaPlayerControls.tsx:1066-1068).- The timeline calls
getBoundingClientRect()on every pointer move (MediaPlayerControls.tsx:829); read the wrapper's position once at pointer enter and keep it until a resize or scroll. - Two Effects only copy callbacks into refs (
MediaPlayer.tsx:277-281,AudioPlayer.tsx:206-212); useuseCommittedReffrom@astryxdesign/core/internal/committed-ref. MediaPlayButton's JSDoc example renders the removedMediaPlayerAudio, and the docs type markers withoutcontent.- The docs promise iPhone and iOS Safari behavior that no iOS run has checked; attach that evidence or describe only the capability.
- The merge of
mainadds an unrelated brace-only edit toapps/sandbox/perf/scenes.perf.spec.ts, and the description still lists the 28 Core strings, which come frommain, and checks that unrelated changes were removed; drop the edit and update the description.
Fixed since the last review: the swizzle proof renders each media part inside its player, and the identity guard no longer flags module state in the store.
Claims and files checked
- Claim: no runtime dependency; verified, no manifest or lockfile changes.
- Claim: 12 components and 2 hooks are exported; verified in the MediaPlayer and Lab indexes.
- Claim: 28 Core catalog strings are part of this change; false, the base already has all 28.
- Claim: no theme package changes, glyphs resolve through
media:*keys with bundled Lucide drawings; verified inmediaIcons.tsx. - Claim: the CLI package list is regenerated and discovery lists the players (changeset); verified for the 12 components and 6 blocks, and its generator check reports it current; the hooks have no discovery kind and ship in the MediaPlayer docs.
- Claim: the docsite preview registry skips hook entries; verified in
generate-data.mjsand its test. - Claim: shortcuts work while focus is inside the player and never fire in a text field; verified by the tests.
- Claim: the bar shows for keyboard focus and hides after 2 s idle while playing; false after a mouse click on the timeline, which holds it like keyboard focus.
- Claim: a touch tap shows the controls and the next tap hides them; verified by the tests.
- Claim: the large play control is pointer-only, focus moves to the player, the spinner is hidden; verified by the tests.
- Claim: a marker with content is a button that opens a popover and takes no pointer while the bar is hidden; verified in Chromium and the source.
- Claim: keys typed in a marker popover don't seek; false for a button in the popover, in Chromium and a unit test.
- Claim: the timeline, readouts and control row stay left to right; verified by the tests.
- Claim: AudioPlayer sits in a Section with artwork, 15/30 s skips, track controls and the system media session; verified by the tests.
- Claim: 38 tests pass; verified.
- Claim: unrelated changes were removed or split; false, a perf-spec edit rides along.
- Claim: each media store probes the volume once (commit message); false, it probes on every media event.
- Files with findings:
MediaPlayer.tsx,MediaPlayerContext.ts,MediaPlayerControls.tsx,VideoPlayer.tsx,AudioPlayer.tsx,mediaStore.ts,MediaPlayer.doc.mjs,MediaPlayer.spec.md(awaiting a decision),apps/sandbox/perf/scenes.perf.spec.ts. - Files clear:
MediaPlayerElement.tsx,mediaIcons.tsx, the MediaPlayer and Lab indexes,MediaPlayer.test.tsx,MediaPlayer.stories.tsx, the six blocks and their docs,generate-data.mjs,data-extraction.test.ts,routes.lock.json,official-packages.json, the swizzle-proof samples, the CLI changeset.
|
/approve-spec 86a7bcc |
There was a problem hiding this comment.
Changes requested. The engineering owner's /approve-spec for this head settles the component:MediaPlayer record, so what remains is implementation: thirteen blocking fixes and two pieces of evidence.
Blocking
- Keys pressed on a button inside a comment marker's popover still seek the video and change the volume (
MediaPlayer.tsx:338-345), which FR12 forbids. - After autoplay, a first mouse press on the timeline keeps the control bar up during playback, because the root holds it on
:focus-visibleinstead of the shared keyboard modality (MediaPlayer.tsx:117-123,:508-510). - The volume probe builds a new
<audio>element on every media event, about four times a second while playing (mediaStore.ts:311). useMediaPlaybackTimerenders the old time after each jump and repairs it in an Effect (MediaPlayerContext.ts:158-162).- Two Effects only copy callbacks into refs and should use
useCommittedRef(MediaPlayer.tsx:277-281,AudioPlayer.tsx:206-212). - Two observers attach in mount-only Effects instead of callback refs (
VideoPlayer.tsx:306-394,MediaPlayerControls.tsx:774-782). - The timeline calls
getBoundingClientRect()on every pointer move (MediaPlayerControls.tsx:829). useMediaPlaybackTimereadsmatchMediaonce instead of Core'suseMediaQuery, and the slider reveal copies the shared container reveal and has drifted from it (MediaPlayerContext.ts:164-171,MediaPlayerControls.tsx:274-296).- The parts share a plain
createContext, so a swizzled part cannot read the package'sMediaPlayer(MediaPlayerContext.ts:62-64). MediaTimebuilds-0:30and0:12 / 1:00from string literals instead of catalog messages (MediaPlayerControls.tsx:1066,:1068).- The
MediaPlayButtonexample uses the removedMediaPlayerAudio, and themarkersdoc type leaves outcontent(MediaPlayerControls.tsx:335,MediaPlayer.doc.mjs:47-50). - Miss: the CLI changeset says discovery lists the
useMediaPlayerhook, but the generated list has no hook entry (.changeset/lab-media-player-cli-discover.md:5). - The unrelated brace edit to
apps/sandbox/perf/scenes.perf.spec.tsshould leave this pull request, and the description should say the 28 media strings already come frommain.
Evidence needed
- iOS Safari results for the documented iOS volume and fullscreen behavior, or docs that describe only the capability.
- Newly live check: the first-load gzip cost of the speed menu and marker popover code on a page that renders the players without them.
Claims and files checked
Claims:
- 12 new Lab components and 2 hooks, with no existing export changed: verified (
packages/lab/src/index.ts). - 28 media strings in
en.jsonas part of this change: false; the base already has them. - No theme package changes, and a regenerated CLI discovery list: verified (its
--checkreports it current). - The docsite groups the family and skips hook entries in the preview registry: verified (
MediaPlayer.doc.mjs,generate-data.mjs). - Shortcuts skip text fields and are announced: verified (
MediaPlayer.tsx:91-115, tests). - Keys typed in a marker popover do not seek: false for buttons in the popover.
- The bar sits 8px inside with the element and container radii, hides after 2 s idle, and stays while paused, scrubbing or a menu is open: verified, except the hold after a first mouse press above.
- A tap shows the controls and the next tap hides them; the large play control is pointer-only; the spinner is hidden from assistive technology: verified (tests).
- Markers take no pointer while the bar is hidden: verified (
VideoPlayer.tsx:120-148). - The timeline, times and control row stay left to right: verified (right-to-left tests).
- AudioPlayer sits in a Section with artwork, 15 and 30 s skips, a speed toggle and slider, track controls and the system media controls: verified (tests, source).
- Glyphs resolve through
media:*keys with bundled Lucide fallbacks: verified (mediaIcons.tsx). - 38 family tests: verified; all pass.
- Changeset: discovery lists the players and parts: verified; the
useMediaPlayerhook: false.
Files (33):
MediaPlayer.tsx,MediaPlayerContext.ts,mediaStore.ts,MediaPlayerControls.tsx,VideoPlayer.tsx,AudioPlayer.tsx,MediaPlayer.doc.mjs: findings above..changeset/lab-media-player-cli-discover.md,apps/sandbox/perf/scenes.perf.spec.ts: findings above.MediaPlayerElement.tsx,mediaIcons.tsx, the folderindex.ts,MediaPlayer.test.tsx,packages/lab/src/index.ts: clear.docs/specs/components/MediaPlayer/MediaPlayer.spec.md: approved for this head; clear.- The six
packages/lab/blocksplayers and their six docs: clear. apps/storybook/stories/MediaPlayer.stories.tsx,apps/docsite/scripts/generate-data.mjs,apps/docsite/src/__tests__/data-extraction.test.ts,packages/cli/test/swizzle-proof/samples.mjs: clear.packages/cli/assets/discover/official-packages.json,internal/shadcn-registry/routes.lock.json: generated and current; clear.
| import { | ||
| DropdownMenu, | ||
| DropdownMenuRadioGroup, | ||
| DropdownMenuRadioItem, | ||
| } from '@astryxdesign/core/DropdownMenu'; | ||
| import {useContainerReveal} from '@astryxdesign/core/hooks'; | ||
| import {IconButton, type IconButtonProps} from '@astryxdesign/core/IconButton'; | ||
| import {Popover} from '@astryxdesign/core/Popover'; |
There was a problem hiding this comment.
Newly live check: DropdownMenu serves only variant="menu" and Popover only markers with content, both off by default, but this module holds every part, so a page with only AudioPlayer or MediaPlayButton loads both. architecture:component-import-boundaries INV10 allows an unused optional feature 0.3 KB gzip of first-load JavaScript and asks the pull request to report that delta; please report it for a page that renders AudioPlayer without either feature, and move a feature behind its own import if it is over.
…ayer - Keys pressed in a timeline marker's popover, also on a button, no longer reach the player's shortcuts, so they never seek, change the volume, mute, or toggle playback. - Focus that a pointer gives, such as a click on the timeline after autoplay, no longer holds the video controls, so a mouse that leaves the player hides them. The player reads Core's shared interaction modality; keyboard focus still holds the controls.
- The timeline speaks every marker within 2.5 seconds of its value, half an arrow key step, so stepping through the media speaks each marker. - useMediaPlaybackTime shows a seek in the same render, and reads reduced motion through Core's useMediaQuery. - The caption layout and the timeline observe their current elements, so a replaced element stays observed. - The timeline reads its position once per hover instead of on every pointer move. A resize or a scroll drops the stored position. - MediaTime builds its readouts from catalog messages, so a locale can change the minus sign and the separator. - The docs describe the volume and fullscreen checks by capability, give a marker's `content` in its type, and the play button's example uses MediaPlayerElement.
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: the draft component:MediaPlayer record is unchanged since it was approved, but an approval counts only for the exact head it names, so an engineering owner records the decision for this head by commenting /approve-spec 9769d7f52d1b49e7b9c3c323a744c2ce080feb1f (the author may do so if they are an engineering owner). The popover-key and pointer-focus fixes check out in Chromium, and eight fixes are still required either way.
Required either way
VideoPlayerkeeps its video and bar elements in React state, which the React runtime rules forbid, so own them through callback refs instead (VideoPlayer.tsx:413,:468).useMediaPlaybackTime's remaining Effect only copies the reported time into a ref, so start the anchor inside the frame Effect (MediaPlayerContext.ts:169-172).- The volume probe still builds a new
<audio>element on every media event, about four times a second while playing (mediaStore.ts:311). - Two Effects only copy callbacks into refs and should use
useCommittedRef(MediaPlayer.tsx:297-301,AudioPlayer.tsx:209-212). - The slider reveal copies the shared container reveal and opens on a different pointer query, leaving an empty column beside Mute on touchscreen laptops used with a mouse (
MediaPlayerControls.tsx:264-307). - The parts share a plain
createContext, so a swizzled part cannot read the package'sMediaPlayer(MediaPlayerContext.ts:70-72). - The CLI changeset says discovery lists the
useMediaPlayerhook, but the generated list has no hook entry (.changeset/lab-media-player-cli-discover.md:5). - The unrelated brace edit to
apps/sandbox/perf/scenes.perf.spec.tsshould leave this pull request, and the description should say the 28 media strings already come frommain.
Evidence needed
- The first-load gzip cost of the speed menu and marker popover code on a page that renders the players without them.
- Miss: the public
canSetVolumeJSDoc still names iOS Safari without an iOS run, so describe the capability as the docs now do (mediaStore.ts:48).
Claims and files checked
Review mode: full; reason: author-not-engowner
Claims:
- 12 new Lab components and 2 hooks, with no existing export changed: verified (
packages/lab/src/index.ts). - 28 media strings in
en.jsonas part of the public delta: false; the base already has them. - No theme package changes, and a regenerated CLI discovery list: verified (its check test passes).
- One docsite group, and hook entries skipped in the preview registry: verified (
MediaPlayer.doc.mjs,generate-data.mjs). - Shortcuts are announced and never fire in a text field or from a marker popover: verified (
MediaPlayer.tsx:353-506, Chromium, tests). - The bar sits 8px inside with the element and container radii, hides after 2 s idle, and holds for keyboard focus but not pointer focus: verified (
VideoPlayer.tsx,MediaPlayer.tsx:530-535, Chromium, tests). - A tap shows the controls and the next tap hides them, and a mouse click plays and pauses: verified (tests,
VideoPlayer.tsx:225-238). - The large play control is pointer-only, focus moves to the player, and the spinner is hidden from assistive technology: verified (tests).
- The timeline draws buffering, chapters and dots, glides between time updates, speaks markers within 2.5 s, opens marker popovers in the page theme, ignores the pointer while the bar is hidden, and reads its position once per hover: verified (source, tests, Chromium).
- Captions sit one inset above the bar: verified (
VideoPlayer.tsx:302-394), with the element-state finding above. - The volume and speed sliders open beside their buttons, stay closed under 480px, and the speed button keeps one width: verified (source).
- The timeline, times and control row stay left to right: verified (right-to-left tests).
- Controls a platform cannot honor are not rendered: verified (source).
- AudioPlayer sits in a Section with artwork, 15 and 30 s skips, a speed toggle and slider, track controls and the system media controls: verified (tests, source).
- Glyphs resolve through
media:*keys with bundled Lucide drawings: verified (mediaIcons.tsx). - 44 family tests pass: verified.
- Changeset: discovery lists the players and parts: verified; the
useMediaPlayerhook: false.
Files (33):
VideoPlayer.tsx,MediaPlayerContext.ts,mediaStore.ts,MediaPlayer.tsx,AudioPlayer.tsx,MediaPlayerControls.tsx: findings above..changeset/lab-media-player-cli-discover.md,apps/sandbox/perf/scenes.perf.spec.ts: findings above.MediaPlayerElement.tsx,mediaIcons.tsx, the folderindex.ts,MediaPlayer.test.tsx,MediaPlayer.doc.mjs,packages/lab/src/index.ts: clear.docs/specs/components/MediaPlayer/MediaPlayer.spec.md: unchanged since the owner's approval; waits on approval at this head.- The six
packages/lab/blocksplayers and their six docs: clear. apps/storybook/stories/MediaPlayer.stories.tsx,apps/docsite/scripts/generate-data.mjs,apps/docsite/src/__tests__/data-extraction.test.ts,packages/cli/test/swizzle-proof/samples.mjs: clear.packages/cli/assets/discover/official-packages.json(generated; its check test passes) andinternal/shadcn-registry/routes.lock.json(generated; one entry per new page): clear.
- VideoPlayer lays out caption cues through callback refs on the video and the bar, so no element sits in React state. - Each media store checks once whether script can set the volume, not on every media event. - useMediaPlaybackTime starts its frames from each reported time inside the frame Effect, with no Effect that only copies a value. - The latest playback callbacks and track handlers reach their listeners through useCommittedRef. - A slider reveal opens under a coarse primary pointer, as the container reveal does, so no empty column shows beside Mute when a touchscreen laptop is used with a mouse. - The parts read a shared context, so a swizzled part reads the package's MediaPlayer. - The CLI changeset no longer says discovery lists the useMediaPlayer hook, and an unrelated formatting change to a sandbox spec leaves this pull request.
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: the draft component:MediaPlayer record is unchanged since it was approved, but an approval counts only for the exact head it names, so an engineering owner records the decision for this head by commenting /approve-spec a87456ee3e036b5a9237a5c7d2f56afd78a20539 (the author may do so if they are an engineering owner). This round fixes eight of the ten earlier items, and two fixes are still required either way.
Required either way
- The speed menu and marker popover load on every page with a media part, 30.7 KB gzip of first-load JavaScript by the description's own measurement against the 0.3 KB an unused optional feature may cost, so load them on first use or behind their own import (
MediaPlayerControls.tsx:30-37). - The slider column still repeats the shared container reveal's hover, focus and coarse-pointer conditions by hand, so extend
useContainerRevealwith a collapsing width reveal and drop the copy (MediaPlayerControls.tsx:264-308).
Smaller comment cleanups (two stranded JSDoc blocks and two "See above." comments) are optional.
Claims and files checked
Review mode: full; reason: author-not-engowner
Claims:
- 12 new Lab components and 2 hooks, with no existing export changed: verified (
packages/lab/src/index.ts). - No new strings, since the media strings already exist on
main: verified (the base catalog has them; the diff does not touch it). - No theme package changes, glyphs through
media:*keys with bundled drawings, and a regenerated CLI discovery list: verified (mediaIcons.tsx, the official-packages check passes). - One docsite group, and hook entries skipped in the preview registry: verified (
MediaPlayer.doc.mjs,generate-data.mjs). - Shortcuts are announced and never fire in a text field or from a marker popover: verified (tests).
- The bar sits 8px inside with the element and container radii, hides after 2 s idle, and holds for keyboard focus but not pointer focus: verified (
VideoPlayer.tsx, tests, Chromium). - A tap shows the controls and the next tap hides them, and a mouse click plays and pauses: verified (tests,
VideoPlayer.tsx:225-243). - The large play control is pointer-only and the spinner is hidden from assistive technology: verified (
VideoPlayer.tsx:264-281, tests). - The timeline draws buffering, chapters and markers, speaks markers within 2.5 s, opens marker popovers, ignores the pointer while the bar is hidden, and reads its position once per hover: verified (source, tests, Chromium).
- Captions sit one inset above the bar and keep that line when it hides: verified (Chromium).
- The sliders open beside their buttons under the shared reveal's conditions, stay closed under 480px, and the speed button keeps one width: verified (source, Chromium).
- The timeline, times and control row stay left to right: verified (right-to-left tests).
- Controls a platform cannot honor are not rendered: verified (source).
- AudioPlayer sits in a Section with artwork, 15 and 30 s skips, a speed button and slider, track controls and the system media controls: verified (tests, source).
- 45 family tests pass: verified.
- First-load cost of the speed menu and marker popover: verified as reported; it is the first required fix above.
- Changeset: discovery lists the players and parts: verified (
official-packages.json).
Files (32):
MediaPlayerControls.tsx: findings above.VideoPlayer.tsx,MediaPlayer.tsx,MediaPlayerContext.ts,mediaStore.ts,AudioPlayer.tsx,MediaPlayerElement.tsx,mediaIcons.tsx, the folderindex.ts,MediaPlayer.test.tsx,MediaPlayer.doc.mjs,packages/lab/src/index.ts: clear (the optional comment cleanups above sit inMediaPlayerContext.tsandAudioPlayer.tsx).docs/specs/components/MediaPlayer/MediaPlayer.spec.md: unchanged since the owner's approval; waits on approval at this head.- The six
packages/lab/blocksplayers and their six docs: clear. apps/storybook/stories/MediaPlayer.stories.tsx,apps/docsite/scripts/generate-data.mjs,apps/docsite/src/__tests__/data-extraction.test.ts,packages/cli/test/swizzle-proof/samples.mjs,.changeset/lab-media-player-cli-discover.md: clear.packages/cli/assets/discover/official-packages.jsonandinternal/shadcn-registry/routes.lock.json(generated): clear.
…est.mjs) Per CI&R: the guard that fired on #9832 is the by-name samples.test.mjs check; the Lab lane always runs it, reading the Lab package samples. The full render stays on release checks.
User need
Products that play video or audio either use the browser's built-in controls, which can't be themed and look different in every browser, or build a player from scratch. Astryx has no player today:
Lightboxshows video with the browser's own controls. Builders need video and audio controls that follow their theme, work with a mouse, touch, keyboard, and screen reader, and add no dependency.This is a Lab prototype: it is meant to be reviewed, tried, and reshaped before anything graduates.
Problem and solution fit
<video>/<audio>element keeps playing the media with its controls off, and Astryx controls drive it. Decoding, buffering, caption rendering, picture-in-picture, and platform integration stay with the browser, and the family adds no runtime dependency.VideoPlayerandAudioPlayercover the common layouts.MediaPlayer, its parts, and the hooks cover custom layouts.Current specification
This PR adds
docs/specs/components/MediaPlayer/MediaPlayer.spec.md(component:MediaPlayer, draft). It records the product decisions already made (DEC-1 to DEC-16, DD1, DD2) and leaves the questions below open for the spec owners. No current record admits the API yet.Public delta and caller burden
New
@astryxdesign/labexports; no existing export changes:VideoPlayer,AudioPlayerMediaPlayer,MediaPlayerElement(a<video>or an<audio>, bykind)MediaPlayButton,MediaSeekButton,MediaVolume(Mute with the volume slider it reveals, or Mute alone),MediaTimeSlider,MediaTime,MediaCaptionsButton,MediaFullscreenButton,MediaPlaybackRate(a speed button with a slider, or a speed menu)useMediaPlayer(state and actions),useMediaPlaybackTime(a playback position that advances every animation frame)MediaPlayerState,MediaPlayerActions,MediaPlayerError,MediaTextTrackInfo,MediaTimelineChapter,MediaTimelineMarker,MediaSliderPlacement, and a props type for every part@astryx.mediaPlayer.*strings the family uses are already onmaininpackages/core/locales/en.jsonmedia:*icon-registry key. The CLI's official package list is regenerateduseMediaPlayeranduseMediaPlaybackTimeare the first Lab hooks in the docsCaller decisions: a label; for video, a poster and caption tracks; optional chapters, markers, artwork, and queue handlers. Streaming formats the browser can't play (for example DASH) need an engine the product brings.
Behavior:
</>step through the speed list. Shortcuts never fire in a text field or from inside a marker's popover. Changes are announced through the shared announcement channel.VideoPlayercontrols float in a frosted bar 8px inside the video, with equal padding and no shadow. The video takes the theme's element radius and the bar the container radius. The bar shows on hover, pointer movement, and keyboard focus, and hides after 2 s idle while playing. It stays while paused, scrubbing, a menu or marker popover is open, or keyboard focus is inside; focus that a pointer gives, such as a click on the timeline, doesn't hold it. Before playback, the large play control takes its place, also on hover; keyboard focus inside the bar still shows it. After the end, the bar stays available beside the replay control. Its transition does not move under reduced motion.contentis a button that jumps to its time and opens the content, such as a CommentThread, in a popover in the page's theme. A marker takes no pointer while the video bar is hidden, and keys pressed in its popover, in a text field or on a button, never reach the player's shortcuts. The timeline reads its position once per hover, not on every pointer move.sliderPlacementpicks the side in a custom layout. They animate their width briefly (still under reduced motion) and show their value in a tooltip. In a container narrower than 480px they stay closed. The speed button keeps one width at every speed.AudioPlayersits in a Section container. It shows artwork in front of the title (square by default, any aspect ratio, any media, or a generic audio file icon), skips back 15 s and forward 30 s, pairs a speed button (switches between 1× and the last other speed) with a speed slider, shows previous and next track controls when the product passes handlers, and hands its title, artwork, and transport and track actions to the system media controls once it plays.media:*icon-registry keys, so a theme can restyle them; without a theme entry, Lab draws its bundled Lucide drawings.Design and alternatives
Decided, and recorded in the spec's decision log:
isPlayingor volume props (DEC-4).MediaVolume), the speed controls (MediaPlaybackRate), and the video and audio elements (MediaPlayerElement). Play, seek, the timeline, time, captions, and fullscreen stay separate (DEC-16).Questions for the spec owners
Slidergets nothing media-specific. Today it keeps the core Slider for drag, keys, focus, and value text, clears the Slider's paint through its theme tokens, and draws the track, ranges, markers, and thumb under it. Recommendation: move Slider's behavior into a shared headless hook in core, soSliderand the media timeline each draw their own visuals on one engine. Another option is to keep the token approach.media:*keys, and Lab draws Lucide's glyphs when a theme maps none. Should they become core icon names that every icon set defines?design:bidirectionalityDR6, or should the design record state the media rule?MediaPlaybackRate. Should the menu variant be the default instead?The slider width animation uses the disclosure exception to transform-only motion on the inline axis (DEC-11); please confirm that reading of the motion rule. Each marker with content is its own tab stop today, which does not scale to many comments; next and previous marker keys would replace that.
Evidence
MediaPlayer.test.tsx, 45 tests:AudioPlayernaming, Section container, artwork and its placeholder, previous and next track controls, volume slider, 15/30 s skips, the speed button and slider, and the system media session claimed and released;MediaPlaybackRate's menu variant checks the current speed and reflects its variant without a slider;MediaVolumeputs its slider before Mute and renders Mute alone without it;MediaPlayerElementrenders the element for its kind without the browser's controls; keys pressed in a marker's popover, in a text field or on a button, don't seek, change the volume, or toggle playback; markers are spoken within half an arrow step; the timeline reads its position once per hover;useMediaPlayerreads state and drives actions,useMediaPlaybackTimefollows the reported time while paused and shows a seek in the same render while playing, anduseMediaPlayerthrows outside a player.VideoPlayerloads 231.3 KB gzip up front, most of it Core's runtime that every Astryx page shares. The speed menu and marker popover imports add 30.7 KB gzip (89.5 KB minified) of that, even when the page shows neither. ForAudioPlayerthe numbers are 234.1 KB and 30.9 KB. Core's menu bottom sheet already loads on demand. Loading the speed menu and the marker popover on first use would move those 31 KB out of the first load.Lab/MediaPlayer: Video, VideoWithCaptions, MutedAutoplayLoop, RightToLeft, Audio, AudioWithArtwork, AudioWithWideArtwork, CustomLayout, Chapters, CommentMarkers, BufferedRange, ProgressTicker, FeedClip.Screenshots
Storybook rendered in headless Chromium (2× DPR) with locally generated test media. Frames 1–25 come from the head before the part merge, whose controls render the same way after it; frames 26 and 27 come from the current head. Frames from the main capture (1–6, 11–17, 22, 23, 26) have sensor receipts (story, theme, color mode, direction, viewport, pointer, media state, geometry, settled fonts, page errors) in
receipts.json. Frames 7–10, 18–21, 24, and 25 come from focused runs without receipts: 7–9 use a 5-second clip, 10 stalls the download at 35%, and 19–20 use a generated stand-in image.Before playback: the large play control takes the bar's place.
Hover before playback: the bar stays hidden behind the large play control.
Paused after playback started: the bar shows. The video takes the theme's element radius and the bar its container radius (10px and 12px in neutral).
Paused, dark page.
Hover on Mute: the volume slider opens to its left with a gap, so Mute stays under the pointer.
Captions sit one inset above the bar and keep that line when the bar hides.
Chapters: segments with small gaps. The pointer preview shows the time and the chapter title.
Comment markers: a pointer near a dot previews its comment.
Pressing a marker jumps to its time and opens its CommentThread card in the page's theme.
Buffered range: the lighter part of the track is media loaded ahead of the playhead.
Playing, pointer gone: the bar hides after two seconds.
Touch: a tap shows the controls, and only the next tap hides them.
Keyboard before playback: Tab reaches the bar's Play, and focus inside the bar shows it. The large play control is pointer-only.
Media failed: message and Try again. Focus moves to the player when Try again leaves.
Square theme (Y2K): the player and the bar stay square.
Right-to-left page: the timeline, the times, and the control row stay left to right.
Forced colors, paused.
AudioPlayer in a Section: a generic audio file icon in the square artwork slot, and previous and next track controls beside rewind and fast-forward.
Square artwork in front of the title (a generated stand-in image).
Wide artwork through
artworkAspectRatio={16 / 9}.Hover on the speed button opens the speed slider; the speed shows in a tooltip, and the button keeps one width at every speed.
Hover on Mute opens the volume slider toward the center of the row.
AudioPlayer, dark page.
A video with no controls: hover shows only a 3px progress line.
Feed clips with no control bar: a thin segment per clip, like stories.
Custom layout from the parts: the speed control's menu variant, and
MediaVolumebeside it.useMediaPlayerdrives the percent readout.The menu variant open: every speed, with the current one checked.
Scope
Testing
Run after the part merge: the axe audit for
Lab/MediaPlayer(0 violations, no baseline entries), and the disabled-hover and disabled-cursor audits (pass). The Lab build passes on this head.Not yet done: WebKit and Firefox runs, screen reader passes, a real iOS or Android device (headless touch emulation drops the coarse-pointer state after the first tap), and
pnpm review:pre, which has not been run on this head.Writing rubric results
R1 narration: no proposal, history, or "now/previously" phrasing in the record. The decision log states each boundary in the present tense.
R2 research: none in the record. The player survey stays outside the repository, and its conclusions are one or two sentences inside DEC-1 and DEC-2.
R3 evidence: basis cells cite decisions, records, platform constraints, and conventions; none cites a pull request or commit.
R4 rejected alternatives: three, one line each, in DEC-2, DEC-12, and DEC-16.
R5 change references: none.
R6 open questions: OQ1 to OQ9 are unanswered. OQ1, OQ2, OQ5, OQ8, and OQ9 keep their options side by side.