From bc33e18ca03ee272fda21a4e7a374d1bb56b9af5 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sun, 25 Aug 2024 11:43:46 -0700 Subject: [PATCH] Clarify current track API to note that it changes the track but does not actually cause it to play --- packages/webamp/js/webampLazy.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/webamp/js/webampLazy.tsx b/packages/webamp/js/webampLazy.tsx index e96617e31..212a9ac27 100644 --- a/packages/webamp/js/webampLazy.tsx +++ b/packages/webamp/js/webampLazy.tsx @@ -280,9 +280,14 @@ class Webamp { } /** - * Play a specific track by index + * Set the current track a specific track in the playlist by zero-based index. + * + * Note: If Webamp is currently playing, the track will begin playing. If + * Webamp is not playing, the track will not start playing. You can use + * `webamp.pause()` before calling this method or `webamp.play()` after + * calling this method to control whether the track starts playing. */ - playTrack(index: number): void { + setCurrentTrack(index: number): void { this.store.dispatch(Actions.playTrack(index)); }