[mirotalksfu] - add survey on leave room

main
Miroslav Pejic 4 years ago
parent 45ebd22bda
commit 4ae0e8ad15

@ -10,6 +10,7 @@ const swalImageUrl = '../images/pricing-illustration.svg';
const url = { const url = {
ipLookup: 'https://extreme-ip-lookup.com/json/?key=demo', ipLookup: 'https://extreme-ip-lookup.com/json/?key=demo',
survey: 'https://www.questionpro.com/t/AUs7VZq02P',
}; };
const _PEER = { const _PEER = {
@ -24,6 +25,8 @@ const _PEER = {
sendMsg: '<i class="fas fa-paper-plane"></i>', sendMsg: '<i class="fas fa-paper-plane"></i>',
}; };
const surveyAvtive = true;
let participantsCount = 0; let participantsCount = 0;
let rc = null; let rc = null;
@ -170,7 +173,7 @@ async function initEnumerateDevices() {
}); });
if (!isAudioAllowed && !isVideoAllowed) { 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 { } else {
hide(loadingDiv); hide(loadingDiv);
getPeerGeoLocation(); getPeerGeoLocation();
@ -985,7 +988,11 @@ function handleRoomClientEvents() {
}); });
rc.on(RoomClient.EVENTS.exitRoom, () => { rc.on(RoomClient.EVENTS.exitRoom, () => {
console.log('Room Client leave room'); 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; return url.match(/\.(jpeg|jpg|gif|png|tiff|bmp)$/) != null;
} }
function openURL(url) {
window.location.href = url;
}
// #################################################### // ####################################################
// HANDLE WHITEBOARD // HANDLE WHITEBOARD
// #################################################### // ####################################################

Loading…
Cancel
Save