Instant video-bite hover playback + unified <Video> SSOT (preload policy, rendition cap, poster/fit props)#1493
Merged
Conversation
…x_resolution cap, poster/fit props, admin+markdown surfaces on <Video>) [preview:none]
…ect [preview:none]
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughChangesThe PR centralizes video playback through the shared Video playback pipeline
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant VideoBiteCard
participant Video
participant FilePlayer
participant MuxPlayer
VideoBiteCard->>Video: provide capped preview URL
Video->>FilePlayer: pass preload and fit
FilePlayer->>MuxPlayer: render playback surface
VideoBiteCard->>Video: activate hover playback
MuxPlayer-->>FilePlayer: emit playing event
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What changed
Fast-start / instant hover playback (video bites):
video.tsx: every<Video kind="file">now passes an explicitpreload— defaultmetadata(playback-core loads the manifest immediately and clamps buffering tomaxBufferLength=1: manifest + ~1 segment, then idle), downgraded tononeon Save-Data connections.play()restores full buffering automatically, so hover start rides an already-warm buffer. Publicpreloadprop added for deliberate overrides.toMuxPreviewUrl()(mux-origins.ts, server-safe): appends?max_resolution=720pto public Mux HLS URLs for the ~234px bite hover cards — the only Safari-side rendition cap (native HLS ignores hls.js'scapLevelToPlayerSize; MuxPlayer'smaxResolutionprop needsplaybackId, we usesrc). Signed (?token=) and non-Mux URLs pass through untouched. Verified live: variant count drops 4→3.saveDataEnabled()extracted as the ONE Save-Data source of truth (exported fromuse-video-warmup.ts; its inline check refactored to consume it).startHoverPlayback(always in dev, prod opt-in vialocalStorage.VIDEO_PERF_DEBUG). Measured 16 ms hover→playing on a mounted card.NEAR_VIEWPORT_ROOT_MARGINexported fromuse-near-viewport.ts— SSOT for all three '500px' mount-gate literals (hook default, cards-strip per-index gate, bite-card standalone gate).previewUrlused by BOTH the first-frame facade and the hover player (shared HTTP cache across original + marquee clone); poster-layer invariant documented.Why
Bite hover playback must start instantly with zero visible loading, and all video playback must run through one implementation. The preload default + early mount gate means each near-viewport card holds manifest + first segment before the pointer ever arrives.
Reviewer notes
VideoSourceSelector'sresolveVideoUrlprop is REMOVED (zero hub call sites — all passVideoPreviewComponent). Consumers passing it get a compile error on upgrade.firstFrameOnlyfacade now honorsposterand the newfit="cover"(--media-object-fit) and inherits the preload default (Save-Data aware).simple-markdown-renderer:'video'dropped fromSAFE_HTML_TAGS— chat strips the tag server-side already; a stray tag now renders as escaped text instead of a native player.🤖 Generated with Claude Code
Summary by CodeRabbit