feat(skin): port the publisher skin to VJSC

Merged
MM
2mo ago
+2862-5676

Closes #54. Stacked on #56 (#55 renames). Retarget to mmcc/moq-publisher once #56 lands.

What changed

  • Skin source: packages/skins/src/presets/publisher/ (skin.tsx, capture-controls.tsx, publisher.styles.ts, base.css). It reuses the shared Container, ErrorDialog, Button, ButtonTooltip, FullscreenButton, RadioItem, and the menu/popup styles.
  • Build: packages/skins/build/publisher.ts is owned by the fork. The publisher compiles through the shared VJSC graph under its own skin=default-publisher variant. parseVariant rejects that variant, so the publisher stays out of skinStyles, the catalog, the registry, and installation. Changes to upstream files are small hooks:
    • transform and config fallbacks
    • camera/mic radio-group parts in both targets
    • one i18n render alias
    • two helper exports
    • the plugin call
  • Generated output:
    • HTML: internal/skins/default-publisher/{template,register,skin.css}
    • React: internal/skins/default-publisher/** plus presets/publisher/skin.{tsx,css}
  • core: added component.ts for the 11 publisher UI modules.
  • react: added CameraRadioGroup / MicRadioGroup Root/Value/Options parts, mirroring CaptionsRadioGroup.
  • Removed:
    • both legacy-skin/ copies and gaps.md; the retry gap is closed because a failed publish keeps the Go live look
    • the generate-cache exclusion
    • the sandbox media-pulse token and the @source lines for the publisher packages
    • PublisherSkinTailwind / PublisherSkinTailwindElement: breaking, because the packages now ship CSS only, as upstream does

Behavior notes

  • The look moves toward upstream's default skin: the shared surface, menus, tooltips and dialog. The publisher-specific parts carry over: the status capsule, Go live / live red, the split device controls, and the placeholder.
  • The device caret is hidden through the data-availability the menu forwards to its trigger, no longer by leaving it out of the React render. The React skin test was updated to match.
  • The status dot uses animate-pulse. The package CSS declares the matching keyframes, because VJSC's CSS output leaves keyframes out.
  • Preview mirroring works for a slotted <video> (React). The HTML sandbox slots a custom media element whose <video> lives in its own shadow root. The legacy ::slotted(video) rule couldn't reach it either, so that behavior is unchanged.
  • The React sandbox also needed createPlayer().Provider โ†’ Player. Upstream renamed it during the sync, and that rename broke this sandbox page.

Verification

  • pnpm build:packages, clean pnpm typecheck, pnpm lint
  • @videojs/skins 77 tests pass, including the browser-support audit, which now covers 18 stylesheets with the publisher's included. @videojs/html 543, @videojs/react 633: all pass.
  • Checked headless Chromium with a fake camera and mic:
    • HTML /moq-publisher/ and React /react-moq-publisher/, in both CSS and ?styling=tailwind
    • the placeholder, enable devices, the mic picker menu, and Go live โ†’ LIVE badge, timer, and red "Stop stream"
    • no page errors

๐Ÿค– Generated with Claude Code


Summary by cubic

Ports the publisher skin to VJSC, authoring it in packages/skins/src/presets/publisher and removing the duplicated legacy skin copies from packages/html and packages/react. The skin compiles through the shared VJSC graph under its own default-publisher variant and stays out of the catalog, registry, and skinStyles.

Breaking Changes

  • PublisherSkinTailwind and PublisherSkinTailwindElement are removed; the publisher packages now ship CSS only, like upstream.
  • Core and React gain component declarations for the 11 publisher UI modules, plus CameraRadioGroup and MicRadioGroup parts mirroring CaptionsRadioGroup.

Bug Fixes

  • A failed publish keeps the Go live look, closing the retry gap.
  • The device caret is hidden via data-availability forwarded by the menu instead of being dropped from the React render.
  • Device option groups are named by their translated group label unless the caller supplies one.
  • Publisher controls stay pinned visible so their state matches the bar that never hides.
  • The status dot uses animate-pulse, with matching keyframes declared in the package CSS since VJSC's CSS output omits keyframes.
  • The HTML skin entry registers VideoPublisherElement itself, so <video-publisher> works from the single skin import.
  • The React sandbox was fixed for the createPlayer().Provider โ†’ Player rename from the upstream sync.