Shade the played span of the audio waveform as playback advances - #5826
Draft
lukemelia wants to merge 3 commits into
Draft
Shade the played span of the audio waveform as playback advances#5826lukemelia wants to merge 3 commits into
lukemelia wants to merge 3 commits into
Conversation
In the reading formats, the waveform now mirrors the native player's position: a clip-windowed copy of the bars tracks timeupdate from the mounted audio element, so the played span keeps the accent at full strength while the un-played remainder recedes. A track at rest keeps the waveform's usual weight, and a fitted cell — which mounts no player — is untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
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.
In the reading formats (embedded/isolated), the default audio FileDef preview's waveform now reflects the native player's playback position, in the familiar audio-player idiom: the played portion renders in the full accent while the un-played remainder recedes to a dimmer shade, updating as the track plays and when the user seeks.
How it works
AudioPreviewmirrors playback as a 0–1 ratio from the mounted<audio>element'stimeupdate(plusseeking/emptied), preferring the element's own duration and falling back to the extracted duration before metadata arrives.clipPathwhose window width is the ratio, so partial-bar coverage is smooth rather than stepping bar-by-bar.Testing
file-def-format-templates-test.gts: at rest nothing is marked played; after atimeupdateat 5s of a 10s track, the played layer exists and clips at half the waveform.Integration | FileDef format templatesmodule passes (17 tests, 61 assertions).Resolves CS-12575.
🤖 Generated with Claude Code