Repository navigation
feat(player): add stop() and a Close player button - #548
Merged
Merged
Conversation
usePlayer().stop() pauses and unloads the current track so playerTrackObject becomes null. PlayerPanel's header gets a Close player button wired to it, and the already-ignored onClose prop is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
usePlayer().stop()and a Close player button inPlayerPanel's header.stop()pauses and unloads the current track soplayerTrackObjectbecomesnull.Changes
PlayerProvider: newstop()— bumps the load generation (discarding in-flight loads), pauses/clears the audio element, destroys the YouTube player, clears the video container and resets player state.PlayerPanel: Close button (shown only while a track is loaded) callsstop; the already-ignoredonCloseprop is removed (breaking, noted in CHANGELOG).loadedmetadataevents from a stopped audio element are ignored.stop()and the button; CHANGELOG entries.Test plan
pnpm lint(incl.tsc --noEmit) passed before the final small commit. Tests were not completed locally (disk full); relying on PR CI. Playground was started for a manual check.Screenshots
N/A (single icon button in the panel header).
Risk
Intent
change, depth standard: new public API plus a removed prop. An independent review found no important issues; two minor findings were addressed (lateloadedmetadata, dead Close button when idle). Remaining minor: audiosrcis not cleared on stop; YouTube-path and late-load tests are not covered.How to revert
Revert the merge commit.
Deployment notes
Target
develop. Ships with the next lockstep release; consumers passingonClosemust remove it.