Skip to content

Homepage: YouTube embeds, dark mode toggle, NLE playhead fixes#10

Open
jhodges10 wants to merge 3 commits intomainfrom
jhodges10/youtube-embeds-v2
Open

Homepage: YouTube embeds, dark mode toggle, NLE playhead fixes#10
jhodges10 wants to merge 3 commits intomainfrom
jhodges10/youtube-embeds-v2

Conversation

@jhodges10
Copy link
Copy Markdown
Collaborator

Summary

  • YouTube embeds: Remove Cross-Origin-Embedder-Policy: require-corp header that was blocking YouTube iframes from loading on the homepage
  • Dark mode toggle: Simplify from a 3-option dropdown (light/dark/system) to a single toggle button with dark mode as default
  • NLE playhead fixes: Resolve "Maximum update depth exceeded" crash during playback, fix playhead position drift after zoom changes, and fix stale drag calculations
  • Click-to-snap: Clicking anywhere in the timeline track area now snaps the playhead to that position and allows continued drag — matching the UX of professional NLE tools

Changes

  • next.config.ts — Remove COEP header blocking cross-origin embeds
  • src/app/layout.tsx — Set dark as default theme, remove system theme
  • src/components/layout/dark-mode.tsx — Replace dropdown with simple toggle button
  • src/components/nle/index.tsx — Derive playhead position from scroll percentage (eliminates cascading useEffect), compute drag position from mouse event directly, add click-to-snap on timeline tracks
  • Stable props passed to ContentRenderer to prevent YouTube iframe remounting during playback
  • CSS & styling updates across globals.css, nle.css, sequence.tsx

Test plan

  • Verify YouTube embed loads and plays on the homepage
  • Verify dark/light mode toggle works, defaults to dark
  • Press spacebar to play — no console errors, smooth scrolling
  • YouTube video should not reload during playback
  • Zoom in/out on timeline, then drag playhead — position should be accurate
  • Click anywhere on timeline tracks — playhead snaps to that position
  • Click and drag on timeline tracks — playhead follows mouse smoothly

…head fixes

- Remove Cross-Origin-Embedder-Policy header that blocked YouTube iframe embeds
- Simplify dark mode toggle to a single button (light/dark) with dark as default
- Fix "Maximum update depth exceeded" error during NLE playback by deriving
  playheadPosition from scrollPercentage instead of cascading useEffect setState
- Fix playhead position drift after zoom by using calculatedTimelineWidth
  (synchronous useMemo) instead of async ResizeObserver state
- Fix stale closure in drag handler that used initial timeline width after zoom
- Compute drag position directly from mouse event instead of react-draggable
  internal state to prevent coordinate drift
- Prevent YouTube player from resetting during playback by passing stable props
  to ContentRenderer
- Add click-to-snap on timeline tracks so clicking anywhere in the track area
  snaps the playhead and allows continued drag

Signed-off-by: Jeff Hodges <[email protected]>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
otio-website Ready Ready Preview, Comment Apr 14, 2026 11:30pm

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Jeff Hodges <[email protected]>
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