diff --git a/public/js/Room.js b/public/js/Room.js index 6903d35..0daca1c 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -10,6 +10,7 @@ const swalImageUrl = '../images/pricing-illustration.svg'; const url = { ipLookup: 'https://extreme-ip-lookup.com/json/?key=demo', + survey: 'https://www.questionpro.com/t/AUs7VZq02P', }; const _PEER = { @@ -24,6 +25,8 @@ const _PEER = { sendMsg: '', }; +const surveyAvtive = true; + let participantsCount = 0; let rc = null; @@ -170,7 +173,7 @@ async function initEnumerateDevices() { }); if (!isAudioAllowed && !isVideoAllowed) { - window.location.href = `/permission?room_id=${room_id}&message=Not allowed both Audio and Video`; + openURL(`/permission?room_id=${room_id}&message=Not allowed both Audio and Video`); } else { hide(loadingDiv); getPeerGeoLocation(); @@ -985,7 +988,11 @@ function handleRoomClientEvents() { }); rc.on(RoomClient.EVENTS.exitRoom, () => { console.log('Room Client leave room'); - window.location.href = '/newroom'; + if (surveyAvtive) { + openURL(url.survey); + } else { + openURL('/newroom'); + } }); } @@ -1055,6 +1062,10 @@ function isImageURL(url) { return url.match(/\.(jpeg|jpg|gif|png|tiff|bmp)$/) != null; } +function openURL(url) { + window.location.href = url; +} + // #################################################### // HANDLE WHITEBOARD // #################################################### diff --git a/public/js/newroom.js b/public/js/newRoom.js similarity index 100% rename from public/js/newroom.js rename to public/js/newRoom.js