Honour asset.speed in preview playback#147
Merged
Merged
Conversation
|
🎉 This PR is included in version 2.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Closes #145.
asset.speedround-tripped throughupdateClip/getEditand rendered correctly, but canvas preview always played at 1x. This makes preview playback, the toolbar, and timeline resizing speed-aware so preview matches the rendered output.Playback parity. Renders map clip time to source time as
speed × (trim + t)— trim is scaled by speed too, and audio is resampled (pitch shifts). Preview now uses the same mapping:playbackRate/Howlerrate()set fromasset.speed, all seeks and drift correction target the speed-adjusted source time,preservesPitchdisabled to match the resampled render.speed: 0previews as a frozen frame with no audio, as rendered. Applies to video and audio clips.Toolbar speed control. New control in the media toolbar (video/audio): log-scaled slider centred on 1x, presets 0.25x–4x, editable value input, range 0.1–10. Changing speed rescales clip
lengthandtrimbyoldSpeed/newSpeedso the clip keeps the same source window at the new pace;auto/endlength intents are preserved. One undo entry per change.Speed-aware resize cap. Timeline resize stops where source media runs out (
duration/speed − trim, via newPlayer.getMaxLength()). Growth-only: clips already longer than the source window keep their length (renders freeze the last frame past source end, so over-long clips stay valid).Verify: load
src/templates/speed.json, play — segment pace and pitch should match a render of the same JSON. Change speed on a clip via the toolbar and confirm the clip rescales; drag a video clip's right edge and confirm it stops at the source end.npx jest(1886 tests) covers the mapping, max-length maths, and toolbar rescale.