added lite version
This commit is contained in:
@@ -338,6 +338,17 @@ function handleCommand(msg) {
|
||||
if (id === state.np.stationId && (state.np.playing || state.np.loading)) return;
|
||||
if (id === _pendingStationId) return;
|
||||
_pendingStationId = id;
|
||||
// Stop old audio immediately — mirror the UI path where the station
|
||||
// object is already available and player.stop() fires synchronously
|
||||
// inside player.play(). Without this, the old stream keeps playing
|
||||
// for the full round-trip of the metadata fetch below.
|
||||
endCurrentSession();
|
||||
try { player.stop(); } catch { /* ignore */ }
|
||||
state.np.playing = false;
|
||||
state.np.loading = true;
|
||||
state.np.station = null;
|
||||
state.np.stationId = id;
|
||||
render();
|
||||
const gen = ++_cmdGen;
|
||||
api.get(`/api/stations/${id}`).then((st) => {
|
||||
// Bail if a newer command superseded this one while the
|
||||
|
||||
Reference in New Issue
Block a user