129 mots
1 minute
2. 音乐播放器持久化 (Persistent BGM)
2026-06-15
Pas d'étiquettes
Cet article n'a pas de traduction pour la langue actuelle. Retour à la langue principale.

本文档介绍了博客音乐播放器的全局持久化原理及音轨(Tracks)配置入口,以供 AI 在修改时参考。

# AI Collaboration Reference: Persistent BGM Player
## Context & Rules
- **Implementation**: The music player uses Svelte and persists across page transitions because the project uses Swup for client-side routing, and the Navbar (which houses the player) is deliberately kept outside the Swup replacement container.
- **Location**: `src/components/MusicPlayer.svelte` and `src/stores/musicStore.ts`.
- **Modification**: To change the audio source or manage playlist tracks, configure the `musicConfig` object inside `src/config.ts`. The vanilla Zustand store `musicStore.ts` initializes the playlist using `musicConfig.tracks` and persists playback states in local storage. Do not hardcode tracks directly inside `MusicPlayer.svelte`.
2. 音乐播放器持久化 (Persistent BGM)
https://blog.aquamarinez.com/fr/docs/fuwari/advanced-customization/ai-guide/02-bgm-system/
Auteur
Aquamarine
Publié le
2026-06-15