Smooth homepage carousel auto-advance for videos - #35
Draft
austinmrobinson wants to merge 7 commits into
Draft
Conversation
Videos were reaching the native ended state, which flashes the poster (usually the first frame) before the crossfade. Start the next slide during the last moments of the clip and freeze the outgoing frame so the transition never shows a loop. Co-authored-by: Austin Robinson <austinrobinsondesign@gmail.com>
Co-authored-by: Austin Robinson <austinrobinsondesign@gmail.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Mount and fully preload the upcoming slide, then start playback in useLayoutEffect so the incoming video is already moving when the crossfade begins instead of appearing as a poster still. Co-authored-by: Austin Robinson <austinrobinsondesign@gmail.com>
Pause on a late frame and drop the poster before play() on the incoming video, so the browser cannot flash the first frame when the new clip starts. Co-authored-by: Austin Robinson <austinrobinsondesign@gmail.com>
Keep preload stable and render the poster as an overlay image instead of the video poster attribute. Changing those on a playing element was seeking the outgoing clip back to frame 0 at the start of the fade. Co-authored-by: Austin Robinson <austinrobinsondesign@gmail.com>
If the browser seeks back to 0 on ended, snap to a late frame in useLayoutEffect so the crossfade never shows the poster restart. Co-authored-by: Austin Robinson <austinrobinsondesign@gmail.com>
Browsers still seek outgoing clips to 0 at ended, which paints a poster flash before React can restore the playhead. Rasterize the current frame and crossfade that still so the handoff cannot show a restart. Co-authored-by: Austin Robinson <austinrobinsondesign@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-advance on the homepage preview is worth keeping: it is how extra shots get seen, especially on Tesla’s longer set, and videos already have a natural end that should cue the next slide. The jank was the handoff, not the idea.
Videos were playing through to the native
endedstate. Browsers then seek back to frame 0 (the poster / first frame) for a beat, and only after that did the crossfade start. That is the loop-and-restart hitch.This change:
<video>cannot flash the first frameTesting: hover Nominal and Paper Crowns through a video-to-video handoff; hover Tesla through the color-tool video into the next still. There should be no first-frame flash before the next slide.