fix(volume): load persisted volume on startup and allow adjustment before playback
- Initialize volume from localStorage instead of hardcoded 75 - Pass volume and onVolumeChange to NowPlayingBar even when no track is playing - Users can now adjust volume before playing anything (important to prevent loud surprises when volume was left at max)
This commit is contained in:
1 parent
4548845fbf
commit
19fa233f7e
1 file changed
+4
-1
@@ -131,6 +131,7 @@
|
||||
stopPolling,
|
||||
reset as resetPlayer,
|
||||
getPlayerState,
|
||||
getVolume,
|
||||
type PlayingTrack,
|
||||
type PlayerState
|
||||
} from '$lib/stores/playerStore';
|
||||
@@ -501,7 +502,7 @@
|
||||
let isPlaying = $state(false);
|
||||
let currentTime = $state(0);
|
||||
let duration = $state(0);
|
||||
let volume = $state(75);
|
||||
let volume = $state(getVolume()); // Load persisted volume from localStorage
|
||||
let isFavorite = $state(false);
|
||||
|
||||
// Queue/Shuffle State (from queueStore subscription)
|
||||
@@ -3058,6 +3059,8 @@
|
||||
onCast={openCastPicker}
|
||||
{isCastConnected}
|
||||
queueOpen={isQueueOpen}
|
||||
{volume}
|
||||
onVolumeChange={handleVolumeChange}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in new issue
Block a user