feat: scaffold API, commands and tests#2
Merged
jjhafer merged 1 commit intosilvermine:masterfrom Mar 19, 2026
Merged
Conversation
pmorris-dev
approved these changes
Mar 18, 2026
pmorris-dev
left a comment
There was a problem hiding this comment.
I won't block on these suggestions. Leaving it up to you, @velocitysystems.
jjhafer
reviewed
Mar 18, 2026
jjhafer
approved these changes
Mar 18, 2026
jjhafer
approved these changes
Mar 19, 2026
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.
Summary
Scaffolds the API contract for headless native audio playback: Tauri commands, TypeScript bindings, state machine, event system, and mock Rust implementation.
API design inspired by Vidstack's audio provider model, adapted for native platform integration with OS transport controls (lock screen, notification shade, headphone buttons)
Architecture
State machine with 7 statuses (
Idle,Loading,Ready,Playing,Paused,Ended,Error) gates transport actions (load,play,pause,stop,seek) at both the Rust and TypeScript layers. The TypeScript type system enforces this via discriminated unions — only valid actions are available on thePlayerobject for a given status.Two event channels separate high-frequency time progression from infrequent state transitions:
state-changed— status transitions, settings, errors (fullPlayerState)time-update— currentTime/duration progression (lightweightTimeUpdate, ~250ms during playback)Always-available controls (
setVolume,setMuted,setPlaybackRate,setLoop,listen,onTimeUpdate) are not gated by status — they work regardless of playback state.Design decisions
AudioActionResponsewith expected-status metadata; settings return the updatedPlayerWithAnyStatusdirectlyTest plan
npm run standardspasses (eslint, tsc, markdownlint, clippy, rustfmt, commitlint, check-node-version)npm testpasses (23 TypeScript + 24 Rust tests)