Skip to content

feat(player): add stop() and a Close player button - #548

Merged
Andreas-Garcia merged 2 commits into
developfrom
feature/player-stop-button
Nov 12, 2026
Merged

Andreas-Garcia merged 2 commits into
developfrom
feature/player-stop-button

Conversation

@Andreas-Garcia

Copy link
Copy Markdown
Member

Summary

Adds usePlayer().stop() and a Close player button in PlayerPanel's header. stop() pauses and unloads the current track so playerTrackObject becomes null.

Changes

  • PlayerProvider: new stop() — 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) calls stop; the already-ignored onClose prop is removed (breaking, noted in CHANGELOG).
  • Late loadedmetadata events from a stopped audio element are ignored.
  • Tests for stop() and the button; CHANGELOG entries.

Test plan

  • Local: 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 (late loadedmetadata, dead Close button when idle). Remaining minor: audio src is 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 passing onClose must remove it.

Andreas-Garcia and others added 2 commits November 12, 2026 15:26
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>
@Andreas-Garcia
Andreas-Garcia merged commit 90212dc into develop Nov 12, 2026
3 checks passed
@Andreas-Garcia
Andreas-Garcia deleted the feature/player-stop-button branch November 12, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant