From 8cd13269ec12978ead7cd5d3d42712a21d8661e9 Mon Sep 17 00:00:00 2001 From: Ginger Wong Date: Tue, 7 Jul 2020 23:35:09 -0700 Subject: [PATCH] clean up consts a bit --- webroot/js/utils.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webroot/js/utils.js b/webroot/js/utils.js index 1fa5bf2ff..470d81dae 100644 --- a/webroot/js/utils.js +++ b/webroot/js/utils.js @@ -1,12 +1,15 @@ + +const LOCAL_TEST = true; + + const MESSAGE_OFFLINE = 'Stream is offline.'; const MESSAGE_ONLINE = 'Stream is online.'; -// const URL_PREFIX = ''; -const URL_PREFIX = 'https://goth.land'; +const URL_PREFIX = LOCAL_TEST ? 'https://goth.land' : ''; const URL_STATUS = `${URL_PREFIX}/status`; const URL_STREAM = `${URL_PREFIX}/hls/stream.m3u8`; -const URL_WEBSOCKET = URL_PREFIX +const URL_WEBSOCKET = LOCAL_TEST ? 'wss://goth.land/entry' : `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/entry`;