fix: pass clip-relative 0 to media-seek-request in resetPlaybackIfNeeded#1844
Open
tonze wants to merge 1 commit into
Open
fix: pass clip-relative 0 to media-seek-request in resetPlaybackIfNeeded#1844tonze wants to merge 1 commit into
tonze wants to merge 1 commit into
Conversation
#resetPlaybackIfNeeded dispatches seekableStart() (absolute) to media-seek-request, but since 1.14.0 the seek handler treats the detail as clip-relative and boundTime() adds clipStartTime back. This double- adds clipStartTime, jumping clipped players to ~ clip end on play() after a clip ends or when realCurrentTime < seekableStart. Pass 0 instead — boundTime's isStart clamp resolves 0 + clipStartTime (<= seekableStart) to seekableStart(), the intended target. Safe for all video types: clipped on-demand (-> clipStartTime), non-clipped (-> 0), live DVR (-> DVR window start). Fixes the auto-advance / replay-after-clip-end regression that appeared in 1.14.0 (maverick 0.44.1) when currentTime became clip-relative. This contribution was created with the support of GLM-5.2.
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
Fixes
#resetPlaybackIfNeededdispatching an absoluteseekableStart()value tomedia-seek-request, which the seek handler treats as clip-relative — causingboundTime()to double-addclipStartTimeand jump clipped players to ~ clip end onplay().Why
Since 1.14.0 (maverick 0.44.1),
currentTimeand seek requests are clip-relative —media-time-sliderdispatchespercent / 100 * duration(0 to clip-window), andboundTime()converts clip-relative to absolute by addingclipStartTime. But#resetPlaybackIfNeededwas not updated and still passes the absoluteseekableStart()where a clip-relative value is expected:Result: calling
play()on a clipped player that has ended (or whoserealCurrentTime < seekableStart) jumps to ~ clip end instead of clip start. This breaks auto-advance in playlist-style UIs where each item is a clip of a longer video, and any "replay after clip end" flow.How
Pass clip-relative
0instead of absoluteseekableStart().boundTimeaddsclipStartTimeback, and itsisStartclamp resolves0 + clipStartTime <= seekableStarttoseekableStart()— exactly the intended target.if (shouldReset) { this.dispatch('media-seek-request', { - detail: seekableStart(), + detail: 0, trigger, }); }Safe for all video types
boundTime(0, store)resolves correctly for every video type via theisStartclamp (clippedTime = 0 + clipStartTime <= seekableStartalways holds sinceseekableStart = max(mediaStart, clipStartTime)):Verified locally across all three cases — no regressions for non-clipped or live DVR playback.
Testing
play()after clip end now seeks tocurrentTime = 0(realCurrentTime = clipStartTime) instead of clip end.play()after ended seeks to 0 (unchanged).seekableStartsemantics for live DVR preserved.Environment
currentTimewas absolute and seeks did not route throughboundTime.This contribution was created with the support of GLM-5.2.