dVideo = null;
        let selectedAudioDevices = [];

        function toggleBroadcastOptions() {
            const roomName = document.getElementById('roomName').value.trim();
            const broadcastOptions = document.getElementById('broadcastOptions');
            broadcastOptions.classList.toggle('visible', roomName.length > 0);
        }

        function sanitizeDeviceName(deviceName) {
            return String(deviceName).toLowerCase().replace(/[\W]+/g, "_");
        }

        func