) {
                url.searchParams.set('vd', '0');
            } else if (selectedVideo) {
                url.searchParams.set('vd', selectedVideo);
            }

            if (selectedAudioDevices.length === 0) {
                url.searchParams.set('ad', '0');
            } else {
                url.searchParams.set('ad', selectedAudioDevices.join(','));
            }

            const roomName = document.getElementById('roomName').value.trim();
            const password = document.g