Skip to content

fix: desktop scenes can render black — reveal clip only after a painted frame - #8

Open
patrobinsonai wants to merge 1 commit into
oso95:mainfrom
patrobinsonai:fix/desktop-video-paint
Open

fix: desktop scenes can render black — reveal clip only after a painted frame#8
patrobinsonai wants to merge 1 commit into
oso95:mainfrom
patrobinsonai:fix/desktop-video-paint

Conversation

@patrobinsonai

Copy link
Copy Markdown

The bug

On desktop, loadClip() adds has-clip (hiding the still poster) on the video's first seeked event, and primeVideo() explicitly bails when !isMobile(). But a muted video that has never played doesn't reliably paint a frame on seek — the exact quirk the mobile path already guards against with poster-until-paint + first-touch priming. When a desktop browser hits this, the poster is hidden, the video stays unpainted, and the visitor sees a black stage while the scrub logic runs on happily underneath.

Repro

Build any world, open it in a desktop Chromium context where seek-to-paint doesn't kick in before the first seeked (embedded Chromium/webviews hit it consistently; standard Chrome can hit it during first-load blob buffering). Scroll: sections go dark instead of scrubbing.

The fix (4 lines)

  • Reveal has-clip via requestVideoFrameCallback — i.e. only once a frame has genuinely painted — with the previous seeked listener kept as the fallback for browsers without rVFC.
  • Let primeVideo() run everywhere, and prime on loadeddata for fine-pointer devices (muted autoplay is permitted on desktop; touch keeps the existing first-gesture priming).

Verified on two production builds (5-scene and 4-scene chains, architecture A): desktop black-stage gone, mobile behaviour unchanged, reduced-motion path untouched.

…ed frame, prime on all platforms

On desktop the engine swapped the still poster for the video on the first
'seeked' event and never primed playback. A muted video that has never
played does not reliably paint a frame on seek (the same quirk the mobile
path already guards against), so desktop visitors could get a black stage
while the scrub logic ran on happily underneath.

- reveal .has-clip via requestVideoFrameCallback (an actually painted
  frame) when available, falling back to 'seeked' where rVFC is missing
- primeVideo() no longer bails on desktop; loadeddata primes immediately
  on fine-pointer devices (muted autoplay is permitted there), keeping
  the existing first-gesture priming on touch
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