Instruction file imported from ceifeirocv/podcast-app (
.github/instructions/player-and-downloads.instructions.md). Copyright stays with the author.
Audio Playback Rules (Expo SDK 55)
- Prefer
expo-audiopatterns for playback and status handling. - Keep one source of truth for playback state: current episode, queue, position, speed, and playing flag.
- Handle app background behavior intentionally (audio mode + lock screen metadata where needed).
- Always handle loading, buffering, and error states in player UI.
Offline Download Rules
- Persist episode downloads with
expo-file-systemAPIs. - Store audio files in app-managed directories; keep a metadata index in app storage/state.
- Metadata must include at least:
- episode id/guid
- feed id
- title
- local file URI
- file size
- download timestamp
- last played position
- On playback start, prefer the local file if present; otherwise stream the remote URL.
- Add cleanup policies for stale or failed partial downloads.