components
All repositories: gitoria
8.6 KB
# MP — media player, first version (mobile first)Worker MP (Atlas). Mission: missions/MP-media-player.md (caramboleyo: "start a mobile first layout for a media player in components andlayouts"). Branches: `mp-player` in both repos, worktrees under /media/STORAGE/claude-scratch/atlas/MP/. NOT merged, NOT deployed, NOT pushed.## What was built**components.hybriel.worldapi.org, commit dd003e5 (branch mp-player)**- `components/media-player/media-player.hl` — the player, pure Hybriel (no JavaScript file): the browser's own `<video>` / `<audio>`element plays; the component draws its own controls around it. Video is 16:9 letterboxed (`object-fit: contain`); audio shows a coverimage (`cover`) with the title and artist. Controls, all at least 44 px (the play / pause one 52 px, the largest): a seek bar you dragwith a finger (pointer events, `setPointerCapture`, `touch-action: none`; the played part in the accent, the buffered part lighter,a thumb dot; the whole strip is a 44 px touch area with a thin visible bar), back 10 s, play / pause (two icons toggled by a class, sothe DOM is not re-created), forward 10 s, current time / total time, mute (two icons), playback speed 1 / 1.25 / 1.5 / 2 (one buttonstepping through them), fullscreen on video (`requestFullscreen`). Keyboard: the video takes the focus (`tabindex = 0`), Spaceplays / pauses, ArrowLeft / ArrowRight jump 10 s; the seek bar itself takes the keyboard too (arrows, Home, End).- The queue under the player: `queue = [{ src, title, dur }]`, dense rows (44 px tap rows that look thin — the touch area is thepadding, the visible rows hug their text), the item whose `src` plays marked with the accent colour on a surface, nothing else. A tap(and the end of an item) calls the host's `onPlay(src)` function (hybriel#87); the host hands a new `src` back and the player is builtanew with it. `autoPlay = "true"` (the demo sets it after a pick) starts the new item at once.- The media element loads its metadata DURING the page parse, before the handlers bind: `loadedmetadata` / `durationchange` / the first`progress` have already fired when the component is live, so the total time and the buffered part would stay at 0. Fixed the codeeditor's way: a 100 ms CSS animation (`animationiteration`) on the video (and on the cover image — the audio element is `display:none`,where a CSS animation never runs) reads duration, buffered and mute state once the page is live, then turns itself off.- `components/icons/icons.hl` — the new icons `play`, `pause`, `skipBack`, `skipForward`, `volume`, `volumeOff`, `fullscreen`, in thesame style (one path, stroke = currentColor). The volume and play paths were redrawn once to centre them optically.- `components/media-player/demo.hl` + route `/media-player` + `README.md` + an entry in `components/index.hl`. The demo's media files(public domain, made with ffmpeg here): a 30 s test video (testsrc2 + a sine, 320×180, 704 KB), a 45 s tone (mp3, 270 KB), a coverPNG (a music note drawn as SVG, rendered with rsvg-convert).- `lib/media.hl` — the demo's media served from `storage/media` as a **function route**: a Bytes body (a file route would hand aString; a media element needs the bytes), the right content type (video/mp4, audio/mpeg, image/png) and **HTTP Range answers**(206 + Content-Range), so the browser's media element can seek without downloading the whole file. Hybriel's own file routescannot do ranges or Bytes bodies yet (WebFramework's `serveFile` notes it), which is why this is a function route.- Gate (`tests/browser.mjs`): 35 new checks in a "MP" block (the home link, the README, no .js file, the media files served with theright type, 16:9, the controls exist, play by a real click, the time and played bar follow, the buffered part, Space pauses, theseek bar dragged with real pointer events to 10% and 60% of a 30 s clip, back / forward 10 s by real clicks, the speed cycle1.25 → 1.5 → 2 → 1, the queue rows with the current one marked, a real tap on the second queue item → the audio player with thecover, autoplay, no fullscreen button for audio, mute toggles icon and label, no console errors), then 390 px checks (every control≥ 44 × 44 including the seek strip and both queue rows, the play button the largest, the video 16:9 inside the width, no horizontalscroll) and the new page in the mobile-first, base-look and offline lists (12 public component files now, 11 home entries).**Gate 605/0** (8740–8749). The MP checks fail on the old code (the old app 404s /media-player, the home has no link — verified on agit-archive copy of main on port 8750).**layouts.worldapi.org, commit 5b5dbf0 (branch mp-player)**- `tools/sync-components.sh` now also copies `media-player/media-player.hl` + README (25 files); ran it against components dd003e5, so`components/media-player/` is a byte-verbatim copy (components/SOURCE names the commit).- `components/showcase/media-player.hl` — `/components/media-player`: the player with the same queue inside the app shell (ContentFirst,site header, sidebar), and the README link (`/read/readme-media-player`). `lib/media.hl` (the same function route, storage/media) andthe same media files. `lib/site.hl`: the page in the components overview and its README in the reader's list. `components/styles.hl`:the page root is a block.- `theme/theme.hl` section 3, the themed rules (no fork of the component): the video area a sunken surface with radiusLarge, the seektrack sunken with radiusSmall, the buffered layer the border grey at 60% (the unbuffered end reads as the lighter end of one bar), theplayed part and the thumb the accent, the buttons the theme's plain ones (transparent, surface on hover, radiusSmall), the times muted,the current queue item the accent on a surface, its length the accent too.- `.check-theme-ignore` skips the verbatim copy folder.- Gate: the page added to the route list — **340/0** (8750–8759). `node theme/check-theme.mjs .` → **0 problems**.## Screenshots (looked at, via a fresh reviewer each round)- `/media/STORAGE/claude-scratch/atlas/MP/shots/video-paused-{390,1280}.png` — the video paused: the colour-bar test clip 16:9, the seekbar at 0 with the thumb at the left, one row of controls (back, play, forward, "0:00/0:30", mute, "1×", fullscreen), the queue with"Test clip (video) 0:30" highlighted, the README link.- `video-playing-{390,1280}.png` — playing: the pause icon shows, the played part a short black bar with the thumb at ~5%, the time"0:01/0:30", the video frame advanced.- `audio-queue-{390,1280}.png` — after a tap on the second queue item: no video area, the cover (grey tile, music note) with "Test tone(audio)" and the artist line, the time "0:01/0:45", no fullscreen button, "Test tone (audio) 0:45" highlighted.- `layouts-video-paused-{390,1280}.png`, `layouts-video-playing-{390,1280}.png`, `layouts-audio-queue-{390,1280}.png` — the same in thedark theme: the video area dark, the played part blue (the accent), the current queue item blue on a surface, the shell (header,sidebar) around it.- Reviewed by a fresh reviewer in four rounds: the first found the control row wrapping at 390, misaligned icons (a wrong CSS selector— `.mp-buttons` class vs the `mp-buttons` element — let the site's button padding win), the speed button a long label, the total time0:00 (the load-before-bind problem above), a seek thumb overhanging. All fixed; the last round found nothing left in the player.The one recurring note in the 1280 layouts shots (a header apparently mid-page) is an artifact of Chrome's full-page capture(`captureBeyondViewport`) painting at the page's scroll offset — measured in the live page: the sticky header sits at viewport y = 0.## What is missing / not done- No captions track UI (the README says so); no volume slider (mute only); no picture-in-picture button (the browser's own menu on thevideo still has it). A longer real clip (the demo files are 30/45 s) and a real queue of more than two items would be the next test.- The layouts gate's own per-page screenshots live in `.scratch/gate-shots/` of the worktree (the gate's naming); nothing of the gatechecks the player's behaviour inside layouts beyond the page answering 200 and the theme checks.- Both branches are unmerged and undeployed; Atlas reviews and deploys.## Logs- Gates: components 605/0 (gate8.log), layouts 340/0 (layouts-gate2.log), check-theme 0 problems. Old-code proof: 6/6 MP checks fail onmain (the page 404s).- Processes: every server, gate and Chrome this mission started was stopped by its saved PID; no port of 8740–8759 listens, no Chromewith a cwd under the scratch dir is left, the hl-browser-tier profile dirs are removed.
Branches
- b27b
- mainmain branch
- vl27-resetkey
Latest commits
- a06fc778Reset virtual-list window when the host changes resetKeyAtlas
- 3aab598cRe-vendor complete Hybriel day73 set for virtual-list resetAtlas
- 337ca075MD1 gate check measures frames in the page, not milliseconds from outside, and takes the middle load (components#30)mre
- f5f131c5Record AP29 autoplay comparisons and passing gatesmre
- 51c38187Gate media autoplay on first load and after client mountmre
- a3f2223dRecord successful B44 deployment and live proofmre
- 06c1e021Record passing B44 browser rerunmre
- c9861533Record B44 component proof and browser gate blockermre
- 1b7413beIgnore detached media events and space demo option outputsmre
- ca3b4959Re-vendor complete Hybriel plugins and runtime to day44mre
- df9e7df9Last-item checks run in the browser gate (components#26 fixed on day41); media-player loop is a plain Booleanmre
- 895a5afcRe-vendor complete Hybriel plugins and runtime to day41mre
- 16006bb3Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
- 88397fc3Re-vendor complete Hybriel plugins and runtime to day39mre
- 9b872cedRecord IC28 deployment and live icon verificationmre
- 46fefaa7Count the icons entry in the offline home-page checkmre
- c7e14cabRecord IC28 rerun and unchanged-main baseline comparisonmre
- 5e090ffdRecord IC28 review evidence and gate resultsmre
- adfe2c4dAdd shuffle, repeat and repeatOne shared iconsmre
- c96709c8media-player: skip = false and repeat = 'one' options (jukebox#19)mre