moo
This commit is contained in:
13
script.js
13
script.js
@@ -1517,17 +1517,20 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||
updateManualGlow('A', settings.glowA);
|
||||
updateManualGlow('B', settings.glowB);
|
||||
|
||||
// Dual-Port Logic: Port 5001 is for Listeners, 5000 is for DJs
|
||||
// Check if this is the listener page based on hostname or port
|
||||
const isListenerPort = window.location.port === '5001';
|
||||
const isListenerHostname = window.location.hostname.startsWith('music.') || window.location.hostname.startsWith('listen.');
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
if (isListenerPort || urlParams.get('listen') === 'true') {
|
||||
if (isListenerPort || isListenerHostname || urlParams.get('listen') === 'true') {
|
||||
initListenerMode();
|
||||
}
|
||||
|
||||
if (!isListenerPort) {
|
||||
// Set stream URL to the dedicated listener port (5001)
|
||||
const streamUrl = `${window.location.protocol}//${window.location.hostname}:5001`;
|
||||
if (!isListenerPort && !isListenerHostname) {
|
||||
// Set stream URL to the listener domain
|
||||
const streamUrl = window.location.hostname.startsWith('dj.')
|
||||
? `${window.location.protocol}//music.${window.location.hostname.split('.').slice(1).join('.')}`
|
||||
: `${window.location.protocol}//${window.location.hostname}:5001`;
|
||||
const streamInput = document.getElementById('stream-url');
|
||||
if (streamInput) streamInput.value = streamUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user