feat: playlist support (POC)#9
Draft
velocitysystems wants to merge 5 commits into
Draft
Conversation
3d9c4bf to
d3f7c1e
Compare
d3f7c1e to
9b503fc
Compare
9b503fc to
3e16ffa
Compare
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
Adds playlist support to the Rodio-backed audio player.
Auto-extracts ID3 metadata from loaded items to surface title, artist, and embedded artwork.
Replaces the single-channel state-update event with four typed event channels.
API changes
Breaking
load(src, metadata)→load(playlist, startIndex?)— the single-source signature is gone. Callers now passPlaylistItem[](each item is{ src, metadata? }). For the previous single-track use case, pass a one-item array.setLoop(loop: boolean)→setLoopMode(mode: LoopMode)— boolean replaced with aLoopModeenum (Off/One/All). The Tauri permission rename matches:allow-set-loop→allow-set-loop-mode.player.listen(...)removed — replaced by four typed event channels (see below).PlayerState.title/PlayerState.artistremoved — per-track metadata now lives onPlayerState.playlist[currentIndex].metadata.PlayerState.playlistandPlayerState.currentIndexadded —currentIndexisnullwhenIdle.Added
next(),prev(),jumpTo(index). Allowed inReady/Playing/Paused/Ended/Error(Error allows them so consumers can skip past a broken track without reloading the whole playlist).prev()restarts the current item ifcurrentTime > 3s, otherwise moves to the previous item (with wrap-around inLoopMode.All).LoopModeenum (Off/One/All) — auto-advance behaviour at end of track or end of playlist.PlaylistIteminterface —{ src: string, metadata?: AudioMetadata }.listen):onStateChanged((change: StateChange) => void)— status / error transitions only.onTrackChanged((change: TrackChange) => void)— fires after each item finishes loading; payload carries the enriched playlist item (auto-extracted ID3 title / artist / artwork merged with caller-supplied metadata, caller wins per field).onSettingsChanged((change: SettingsChange) => void)—volume/muted/playbackRate/loopModedeltas.onTimeUpdate((time: TimeUpdate) => void)— high-frequency position updates (~250 ms) plus seek hits.PlaybackStatus.Erroris now inallowedActionsforLoad,Stop,Next,Prev,JumpTo(the recovery surface).next,prev,jump_to,set_loop_mode(replacesset_loop).