gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmaina06fc778Reset virtual-list window when the host changes resetKeyAtlasmain/reports/MP-media-player.md

8.6 KB

  1. # MP — media player, first version (mobile first)
  2. Worker MP (Atlas). Mission: missions/MP-media-player.md (caramboleyo: "start a mobile first layout for a media player in components and
  3. layouts"). Branches: `mp-player` in both repos, worktrees under /media/STORAGE/claude-scratch/atlas/MP/. NOT merged, NOT deployed, NOT pushed.
  4. ## What was built
  5. **components.hybriel.worldapi.org, commit dd003e5 (branch mp-player)**
  6. - `components/media-player/media-player.hl` — the player, pure Hybriel (no JavaScript file): the browser's own `<video>` / `<audio>`
  7. element plays; the component draws its own controls around it. Video is 16:9 letterboxed (`object-fit: contain`); audio shows a cover
  8. image (`cover`) with the title and artist. Controls, all at least 44 px (the play / pause one 52 px, the largest): a seek bar you drag
  9. with a finger (pointer events, `setPointerCapture`, `touch-action: none`; the played part in the accent, the buffered part lighter,
  10. 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, so
  11. the DOM is not re-created), forward 10 s, current time / total time, mute (two icons), playback speed 1 / 1.25 / 1.5 / 2 (one button
  12. stepping through them), fullscreen on video (`requestFullscreen`). Keyboard: the video takes the focus (`tabindex = 0`), Space
  13. plays / pauses, ArrowLeft / ArrowRight jump 10 s; the seek bar itself takes the keyboard too (arrows, Home, End).
  14. - The queue under the player: `queue = [{ src, title, dur }]`, dense rows (44 px tap rows that look thin — the touch area is the
  15. padding, the visible rows hug their text), the item whose `src` plays marked with the accent colour on a surface, nothing else. A tap
  16. (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 built
  17. anew with it. `autoPlay = "true"` (the demo sets it after a pick) starts the new item at once.
  18. - The media element loads its metadata DURING the page parse, before the handlers bind: `loadedmetadata` / `durationchange` / the first
  19. `progress` have already fired when the component is live, so the total time and the buffered part would stay at 0. Fixed the code
  20. editor's way: a 100 ms CSS animation (`animationiteration`) on the video (and on the cover image — the audio element is `display:none`,
  21. where a CSS animation never runs) reads duration, buffered and mute state once the page is live, then turns itself off.
  22. - `components/icons/icons.hl` — the new icons `play`, `pause`, `skipBack`, `skipForward`, `volume`, `volumeOff`, `fullscreen`, in the
  23. same style (one path, stroke = currentColor). The volume and play paths were redrawn once to centre them optically.
  24. - `components/media-player/demo.hl` + route `/media-player` + `README.md` + an entry in `components/index.hl`. The demo's media files
  25. (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 cover
  26. PNG (a music note drawn as SVG, rendered with rsvg-convert).
  27. - `lib/media.hl` — the demo's media served from `storage/media` as a **function route**: a Bytes body (a file route would hand a
  28. String; a media element needs the bytes), the right content type (video/mp4, audio/mpeg, image/png) and **HTTP Range answers**
  29. (206 + Content-Range), so the browser's media element can seek without downloading the whole file. Hybriel's own file routes
  30. cannot do ranges or Bytes bodies yet (WebFramework's `serveFile` notes it), which is why this is a function route.
  31. - Gate (`tests/browser.mjs`): 35 new checks in a "MP" block (the home link, the README, no .js file, the media files served with the
  32. right type, 16:9, the controls exist, play by a real click, the time and played bar follow, the buffered part, Space pauses, the
  33. seek bar dragged with real pointer events to 10% and 60% of a 30 s clip, back / forward 10 s by real clicks, the speed cycle
  34. 1.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 the
  35. cover, autoplay, no fullscreen button for audio, mute toggles icon and label, no console errors), then 390 px checks (every control
  36. ≥ 44 × 44 including the seek strip and both queue rows, the play button the largest, the video 16:9 inside the width, no horizontal
  37. scroll) and the new page in the mobile-first, base-look and offline lists (12 public component files now, 11 home entries).
  38. **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 a
  39. git-archive copy of main on port 8750).
  40. **layouts.worldapi.org, commit 5b5dbf0 (branch mp-player)**
  41. - `tools/sync-components.sh` now also copies `media-player/media-player.hl` + README (25 files); ran it against components dd003e5, so
  42. `components/media-player/` is a byte-verbatim copy (components/SOURCE names the commit).
  43. - `components/showcase/media-player.hl` — `/components/media-player`: the player with the same queue inside the app shell (ContentFirst,
  44. site header, sidebar), and the README link (`/read/readme-media-player`). `lib/media.hl` (the same function route, storage/media) and
  45. the same media files. `lib/site.hl`: the page in the components overview and its README in the reader's list. `components/styles.hl`:
  46. the page root is a block.
  47. - `theme/theme.hl` section 3, the themed rules (no fork of the component): the video area a sunken surface with radiusLarge, the seek
  48. track sunken with radiusSmall, the buffered layer the border grey at 60% (the unbuffered end reads as the lighter end of one bar), the
  49. played part and the thumb the accent, the buttons the theme's plain ones (transparent, surface on hover, radiusSmall), the times muted,
  50. the current queue item the accent on a surface, its length the accent too.
  51. - `.check-theme-ignore` skips the verbatim copy folder.
  52. - Gate: the page added to the route list — **340/0** (8750–8759). `node theme/check-theme.mjs .` → **0 problems**.
  53. ## Screenshots (looked at, via a fresh reviewer each round)
  54. - `/media/STORAGE/claude-scratch/atlas/MP/shots/video-paused-{390,1280}.png` — the video paused: the colour-bar test clip 16:9, the seek
  55. bar 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
  56. "Test clip (video) 0:30" highlighted, the README link.
  57. - `video-playing-{390,1280}.png` — playing: the pause icon shows, the played part a short black bar with the thumb at ~5%, the time
  58. "0:01/0:30", the video frame advanced.
  59. - `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
  60. (audio)" and the artist line, the time "0:01/0:45", no fullscreen button, "Test tone (audio) 0:45" highlighted.
  61. - `layouts-video-paused-{390,1280}.png`, `layouts-video-playing-{390,1280}.png`, `layouts-audio-queue-{390,1280}.png` — the same in the
  62. dark theme: the video area dark, the played part blue (the accent), the current queue item blue on a surface, the shell (header,
  63. sidebar) around it.
  64. - Reviewed by a fresh reviewer in four rounds: the first found the control row wrapping at 390, misaligned icons (a wrong CSS selector
  65. — `.mp-buttons` class vs the `mp-buttons` element — let the site's button padding win), the speed button a long label, the total time
  66. 0:00 (the load-before-bind problem above), a seek thumb overhanging. All fixed; the last round found nothing left in the player.
  67. The one recurring note in the 1280 layouts shots (a header apparently mid-page) is an artifact of Chrome's full-page capture
  68. (`captureBeyondViewport`) painting at the page's scroll offset — measured in the live page: the sticky header sits at viewport y = 0.
  69. ## What is missing / not done
  70. - No captions track UI (the README says so); no volume slider (mute only); no picture-in-picture button (the browser's own menu on the
  71. video 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.
  72. - The layouts gate's own per-page screenshots live in `.scratch/gate-shots/` of the worktree (the gate's naming); nothing of the gate
  73. checks the player's behaviour inside layouts beyond the page answering 200 and the theme checks.
  74. - Both branches are unmerged and undeployed; Atlas reviews and deploys.
  75. ## Logs
  76. - Gates: components 605/0 (gate8.log), layouts 340/0 (layouts-gate2.log), check-theme 0 problems. Old-code proof: 6/6 MP checks fail on
  77. main (the page 404s).
  78. - Processes: every server, gate and Chrome this mission started was stopped by its saved PID; no port of 8740–8759 listens, no Chrome
  79. with a cwd under the scratch dir is left, the hl-browser-tier profile dirs are removed.

Branches

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