Remove temporary media debug messaging and proxy logging
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Maintainer-controlled web client version.
|
||||
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
||||
window.CHGRID_WEB_VERSION = "2026.02.22 R141";
|
||||
window.CHGRID_WEB_VERSION = "2026.02.22 R142";
|
||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||
|
||||
@@ -162,23 +162,13 @@ type RadioSpatialConfig = {
|
||||
export class RadioStationRuntime {
|
||||
private readonly sharedRadioSources = new Map<string, SharedRadioSource>();
|
||||
private readonly itemRadioOutputs = new Map<string, ItemRadioOutput>();
|
||||
private readonly lastStreamStatusAt = new Map<string, number>();
|
||||
private layerEnabled = true;
|
||||
|
||||
constructor(
|
||||
private readonly audio: AudioEngine,
|
||||
private readonly getSpatialConfig: (item: WorldItem) => RadioSpatialConfig,
|
||||
private readonly onStreamStatus?: (message: string) => void,
|
||||
) {}
|
||||
|
||||
private reportStreamStatus(message: string, dedupeKey: string): void {
|
||||
const now = Date.now();
|
||||
const lastAt = this.lastStreamStatusAt.get(dedupeKey) ?? 0;
|
||||
if (now - lastAt < 3000) return;
|
||||
this.lastStreamStatusAt.set(dedupeKey, now);
|
||||
this.onStreamStatus?.(message);
|
||||
}
|
||||
|
||||
cleanup(itemId: string): void {
|
||||
const output = this.itemRadioOutputs.get(itemId);
|
||||
if (!output) return;
|
||||
@@ -327,18 +317,6 @@ export class RadioStationRuntime {
|
||||
element.crossOrigin = 'anonymous';
|
||||
element.loop = true;
|
||||
element.preload = 'none';
|
||||
element.addEventListener('error', () => {
|
||||
this.reportStreamStatus(
|
||||
`Media stream failed: ${streamUrl}`,
|
||||
`error:${streamUrl}`,
|
||||
);
|
||||
});
|
||||
element.addEventListener('canplay', () => {
|
||||
this.reportStreamStatus(
|
||||
`Media stream ready: ${streamUrl}`,
|
||||
`ready:${streamUrl}`,
|
||||
);
|
||||
});
|
||||
const source = audioCtx.createMediaElementSource(element);
|
||||
void element.play().catch(() => undefined);
|
||||
const shared: SharedRadioSource = {
|
||||
|
||||
@@ -185,7 +185,7 @@ let outputMode = localStorage.getItem(AUDIO_OUTPUT_MODE_STORAGE_KEY) === 'mono'
|
||||
let connecting = false;
|
||||
const messageBuffer: string[] = [];
|
||||
let messageCursor = -1;
|
||||
const radioRuntime = new RadioStationRuntime(audio, getItemSpatialConfig, (message) => updateStatus(message));
|
||||
const radioRuntime = new RadioStationRuntime(audio, getItemSpatialConfig);
|
||||
const itemEmitRuntime = new ItemEmitRuntime(audio, resolveIncomingSoundUrl, getItemSpatialConfig);
|
||||
let internalClipboardText = '';
|
||||
let replaceTextOnNextType = false;
|
||||
|
||||
Reference in New Issue
Block a user