Show video frame preview when hovering/dragging the progress slider#3140
Merged
Conversation
…s slider
Extend the progress slider's time popup ("15:23") into a fixed-size card that
also shows a decoded video frame of the hovered (desktop) or dragged (touch)
position, using the new mediamp FramePreview feature (implemented for mpv, VLC
and ExoPlayer backends; backends without it gracefully fall back to the
time-only popup).
- MediaProgressFramePreviewState: requests are aligned to a 2s grid (finer
makes no sense with keyframe-snapped extraction), recent frames are LRU
cached (8 frames, ~650 KB) so scrubbing back is instant, 50ms debounce, and
the decoder is prewarmed at the current playback position when media loads
so the first hover doesn't wait for decoder startup.
- The popup keeps a fixed 160x90dp frame area with a placeholder background
while loading, so its size never jumps.
- For BT sources only positions whose pieces are downloaded are requested, to
avoid stealing piece-deadline priority from the playback position.
Verified end-to-end in the packaged desktop app on both mpv and VLC backends:
first hover < 0.8s, moving to a new position < 0.6s, scrub-back < 0.35s.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
What
长按拖动进度条(触摸)/ 鼠标悬浮进度条(PC)时,原来只显示 "15:23" 的浮窗扩展为一张固定尺寸的卡片,在时间上方显示该位置的视频预览帧。
Built on the new mediamp
FramePreviewfeature (open-ani/mediamp#39) — implemented for mpv, VLC and ExoPlayer; backends without it (AVKit/iOS) gracefully fall back to the time-only popup.Screenshots
Hovering at ~48% while playing at 02:04 — the popup shows the frame at 11:05 (mpv backend, LocalTorrent media):
Moving to ~25% updates the frame (05:24):
While the frame is loading, the popup keeps its final fixed size with a placeholder area — no size jumping:
How
MediaProgressFramePreviewState(video-player commonMain):collectLatestsemantics (newest position wins);MediaProgressSliderrenders the frame in both the hover popup and the drag (thumb) popup; the frame area is a fixed 160×90dp box with a placeholder background.DONE(fromcacheProgressInfoFlow) are requested, so preview seeks never steal piece-deadline priority from the playback position. Non-BT sources are unrestricted.androidMainBitmap /skikoMaininstallPixels).Verification
Notes
FramePreviewis published and the catalog is bumped (CI will fail against 0.0.30).🤖 Generated with Claude Code