@@ -205,14 +233,69 @@ function NowPlaying({ status }: { status: SpotifyStatus }): React.ReactElement |
{np.album ? ` · ${np.album}` : ''}
{np.durationMs ? (
-
- {formatMs(np.positionMs)} / {formatMs(np.durationMs)}
-
+
+
+
+ {formatMs(position)}
+ {formatMs(np.durationMs)}
+
+
) : null}
);
}
+/**
+ * What the device has played this session, newest first, the current track on
+ * top. Spotify does not tell a Connect device what is coming next -- the queue
+ * lives in the app that is casting -- so this is the playlist we can show: the
+ * one that has already happened.
+ */
+function Played({ status }: { status: SpotifyStatus }): React.ReactElement | null {
+ const history = status.history ?? [];
+ if (history.length === 0) return null;
+ const currentId = status.nowPlaying?.trackId ?? null;
+ return (
+