Skip to content

Read the initial paused state from video element - #79

Merged
weotch merged 1 commit into
mainfrom
improve-initial-paused-state
Aug 17, 2026
Merged

Read the initial paused state from video element#79
weotch merged 1 commit into
mainfrom
improve-initial-paused-state

Conversation

@weotch

@weotch weotch commented Aug 17, 2026

Copy link
Copy Markdown
Member

No description provided.

@codesandbox

codesandbox Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for react-visual ready!

Name Link
🔨 Latest commit 41d554f
🔍 Latest deploy log https://app.netlify.com/projects/react-visual/deploys/6a8398fed777290008f5e1f4
😎 Deploy Preview https://deploy-preview-79--react-visual.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@weotch
weotch merged commit 850ffed into main Aug 17, 2026
8 checks passed
@weotch
weotch deleted the improve-initial-paused-state branch August 17, 2026 23:30
@weotch
weotch requested a lite review from Copilot August 17, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates LazyVideoClient to initialize its internal paused state from the underlying <video> element, improving correctness when autoplay begins before React hydration completes.

Changes:

  • Sync internal isVideoPaused state to videoElement.paused immediately after registering play/pause listeners.
  • Preserve existing event-driven paused/play state updates via play/pause DOM events.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 110 to +114
videoElement.addEventListener("play", handlePlay);
videoElement.addEventListener("pause", handlePause);

// Sync state in case the video started playing before hydration
setVideoPaused(videoElement.paused);
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.

2 participants