129 слов
1 минута
2. 音乐播放器持久化 (Persistent BGM)
2026-06-15
Нет тегов
Эта статья не переведена на текущий язык. Показывается на основном языке.

本文档介绍了博客音乐播放器的全局持久化原理及音轨(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/ru/docs/fuwari/advanced-customization/ai-guide/02-bgm-system/
Автор
Aquamarine
Опубликовано в
2026-06-15
Лицензия
CC BY-NC-SA 4.0