Quentin Fuxa commited on
Commit
1fdbcae
·
2 Parent(s): ce14df9 ecd3f4b

Merge pull request #109 from QuentinFuxa/needabetterusername/implement-69

Browse files
whisperlivekit/web/live_transcription.html CHANGED
@@ -282,7 +282,7 @@
282
  </div>
283
  <div>
284
  <label for="websocketInput">WebSocket URL:</label>
285
- <input id="websocketInput" type="text" value="ws://localhost:8000/asr" />
286
  </div>
287
  </div>
288
  </div>
@@ -319,6 +319,12 @@
319
  const linesTranscriptDiv = document.getElementById("linesTranscript");
320
  const timerElement = document.querySelector(".timer");
321
 
 
 
 
 
 
 
322
  chunkSelector.addEventListener("change", () => {
323
  chunkDuration = parseInt(chunkSelector.value);
324
  });
 
282
  </div>
283
  <div>
284
  <label for="websocketInput">WebSocket URL:</label>
285
+ <input id="websocketInput" type="text" />
286
  </div>
287
  </div>
288
  </div>
 
319
  const linesTranscriptDiv = document.getElementById("linesTranscript");
320
  const timerElement = document.querySelector(".timer");
321
 
322
+ const host = window.location.hostname || "localhost";
323
+ const port = window.location.port || "8000";
324
+ const defaultWebSocketUrl = `ws://${host}:${port}/asr`;
325
+ websocketInput.value = defaultWebSocketUrl;
326
+ websocketUrl = defaultWebSocketUrl;
327
+
328
  chunkSelector.addEventListener("change", () => {
329
  chunkDuration = parseInt(chunkSelector.value);
330
  });