Skip to content

refactor(player): reduce video player duplication - #546

Merged
stackia merged 2 commits into
mainfrom
codex/refactor-video-player-dry
Jun 17, 2026
Merged

refactor(player): reduce video player duplication#546
stackia merged 2 commits into
mainfrom
codex/refactor-video-player-dry

Conversation

@stackia

@stackia stackia commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

This refactors the web video player to reduce duplication without splitting the component into new modules or increasing the runtime surface area.

The duplicated active-slot load/autoplay path is now centralized, pending transition stop/cancel is handled in one helper, and video element listener registration is table-driven so add/remove stay in sync.

This also addresses the deferred slot cleanup review feedback from the previous seamless switching PR. When a completed seamless switch schedules the old slot to stop on the next animation frame, that deferred stop is now tracked per slot and canceled before the slot is reused as a new pending slot. This preserves the RAF-based visual handoff while avoiding aborting a newly loaded pending stream.

src/embedded_web_data.h is intentionally not included in this PR.

Validation

  • pnpm exec biome check web-ui/src/components/player/video-player.tsx
  • pnpm run type-check:tsc
  • pnpm exec vite build web-ui
  • git diff --check

@stackia
stackia marked this pull request as ready for review June 17, 2026 09:52
@stackia
stackia merged commit 70c6db8 into main Jun 17, 2026
10 checks passed
@stackia
stackia deleted the codex/refactor-video-player-dry branch June 17, 2026 09:52
@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-546.eastasia.1.azurestaticapps.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant