actually persist playback rate across source swaps - #10
Merged
Conversation
The 0.1.1 fix set el.defaultPlaybackRate, but mux-video does not proxy that property to its inner <video>, so loading a new source still reset playbackRate to 1x. Track the chosen rate in desiredRate and re-assert it on the element from syncFromEl (fires on canplay/loadedmetadata/ timeupdate, so it corrects as soon as the new source is ready). Report desiredRate as state.rate so the transient reset never surfaces to the UI or gets persisted by a consumer.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
kino | 5e106f4 | Commit Preview URL Branch Preview URL |
Jun 26 2026, 11:16 PM |
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
Follow-up to #8. The playback-rate-across-swaps fix in 0.1.1 was a no-op.
el.defaultPlaybackRate = rwas set on the<mux-video>custom element, but mux-video does not proxydefaultPlaybackRateto its inner<video>(it proxiesplaybackRate~38x in its base;defaultPlaybackRateappears only in its React typedefs). So the HTMLload()algorithm still resetplaybackRateto the inner element'sdefaultPlaybackRate(1.0) on every source swap, and the rate dropped to 1x moving to the next lesson.how
desiredRateclosure var.el.playbackRate = desiredRatefromsyncFromElwhenever it drifts.syncFromElruns oncanplay/loadedmetadata/timeupdate/ratechange, so the correction lands as soon as the new source is ready.desiredRateasstate.rateso the brief reset never surfaces to the UI — or gets persisted by a consumer that mirrorsrateto storage.setRateupdatesdesiredRateand patchesrateimmediately. Dropped the deaddefaultPlaybackRatewrites.verification
pnpm test(45) /pnpm typecheck/pnpm lint/pnpm build— all cleanchangeset: patch (→ 0.1.2)