This commit is contained in:
2026-01-02 20:00:10 +00:00
parent c32caaf052
commit 0fb7bc6f9e
7 changed files with 43 additions and 10 deletions

View File

@@ -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;
}