(playback: PlaybackState | null)
| 41 | }; |
| 42 | |
| 43 | const derivePlayback = (playback: PlaybackState | null) => { |
| 44 | const elapsed = playback?.seek ?? 0; |
| 45 | const duration = playback?.duration ?? 0; |
| 46 | |
| 47 | return { |
| 48 | isPlaying: playback?.status === 'playing', |
| 49 | progress: duration > 0 ? (elapsed / duration) * 100 : 0, |
| 50 | elapsedSeconds: elapsed, |
| 51 | remainingSeconds: duration - elapsed, |
| 52 | }; |
| 53 | }; |
| 54 | |
| 55 | type RemoteState = { |
| 56 | connectionStatus: ConnectionStatus; |