Parent
#39 — PRD: AI Radio — Host-driven Channel experience with chat timeline
What to build
Add Radio mode to the Player alongside the existing Classic (queue) mode. The Player supports two playback modes that coexist — only one is active at a time.
Architecture Decision: Preserve Classic Mode
The existing playerStore queue logic (addToQueue, insertNext, removeFromQueue, clearQueue, playQueue, setMode, shuffle) is preserved as-is. Radio mode is additive — it does not replace or remove classic playback. Users can still browse the Library and play tracks manually in queue mode.
What to add (Radio mode)
- A
playbackMode: 'radio' | 'classic' discriminator in the player state
programme: Segment[] and nowPlayingSegmentIndex: number fields (active only in radio mode)
loadProgramme(programme: Programme) → void — called only by the Programme Manager; automatically switches to radio mode
onSegmentEnd event (callback or event emitter) so the Programme Manager can react
- Lookahead: pre-load the next Segment while Now Playing is active. Must handle both file URIs (TrackSegment) and remote TTS URLs (InterlSegment)
Mode switching
loadProgramme() → sets playbackMode: 'radio', stops any classic queue playback
playTrack() / playQueue() → sets playbackMode: 'classic', stops any radio programme playback
- Only one mode is active at a time
What NOT to change
- All existing queue-mutation actions remain
PlayMode (single / ordered / shuffle) remains for classic mode
PlaybackStore (position, volume, rate) is shared between modes
- System controls (lock screen, headphone buttons), audio ducking — unchanged
- Existing tests for classic mode must continue to pass
Acceptance criteria
Blocked by
Parent
#39 — PRD: AI Radio — Host-driven Channel experience with chat timeline
What to build
Add Radio mode to the Player alongside the existing Classic (queue) mode. The Player supports two playback modes that coexist — only one is active at a time.
Architecture Decision: Preserve Classic Mode
The existing
playerStorequeue logic (addToQueue,insertNext,removeFromQueue,clearQueue,playQueue,setMode, shuffle) is preserved as-is. Radio mode is additive — it does not replace or remove classic playback. Users can still browse the Library and play tracks manually in queue mode.What to add (Radio mode)
playbackMode: 'radio' | 'classic'discriminator in the player stateprogramme: Segment[]andnowPlayingSegmentIndex: numberfields (active only in radio mode)loadProgramme(programme: Programme) → void— called only by the Programme Manager; automatically switches to radio modeonSegmentEndevent (callback or event emitter) so the Programme Manager can reactMode switching
loadProgramme()→ setsplaybackMode: 'radio', stops any classic queue playbackplayTrack()/playQueue()→ setsplaybackMode: 'classic', stops any radio programme playbackWhat NOT to change
PlayMode(single / ordered / shuffle) remains for classic modePlaybackStore(position, volume, rate) is shared between modesAcceptance criteria
playbackModefield exists and correctly reflects which mode is activeplayerStoreexposesprogramme,nowPlayingSegmentIndex, andloadProgramme(programme)onSegmentEndfires after each Segment completesloadProgramme()stops classic playback;playTrack()/playQueue()stops radio playbackBlocked by
Segment,Programme)