[mirotalksfu] - confirm mute, hide, eject participants
هذا الالتزام موجود في:
@@ -192,12 +192,16 @@ body {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sessionTime {
|
||||||
|
margin-left: 8px;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
# Style the tab
|
# Style the tab
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
.tab {
|
.tab {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Style the buttons inside the tab */
|
/* Style the buttons inside the tab */
|
||||||
|
|||||||
ثنائية
public/images/participants.png
Normal file
ثنائية
public/images/participants.png
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 1.9 KiB |
@@ -5,6 +5,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
|
|||||||
const RoomURL = window.location.href;
|
const RoomURL = window.location.href;
|
||||||
|
|
||||||
const swalBackground = 'linear-gradient(to left, #1f1e1e, #000000)';
|
const swalBackground = 'linear-gradient(to left, #1f1e1e, #000000)';
|
||||||
|
const swalBg = 'rgba(0, 0, 0, 0.7)';
|
||||||
const swalImageUrl = '../images/pricing-illustration.svg';
|
const swalImageUrl = '../images/pricing-illustration.svg';
|
||||||
|
|
||||||
const url = {
|
const url = {
|
||||||
@@ -268,6 +269,11 @@ function whoAreYou() {
|
|||||||
joinRoom(peer_name, room_id);
|
joinRoom(peer_name, room_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!DetectRTC.isMobileDevice) {
|
||||||
|
setTippy('initAudioButton', 'Enable / Disable audio', 'left');
|
||||||
|
setTippy('initVideoButton', 'Enable / Disable video', 'right');
|
||||||
|
}
|
||||||
|
|
||||||
initAudioButton = document.getElementById('initAudioButton');
|
initAudioButton = document.getElementById('initAudioButton');
|
||||||
initVideoButton = document.getElementById('initVideoButton');
|
initVideoButton = document.getElementById('initVideoButton');
|
||||||
if (!isAudioAllowed) initAudioButton.className = 'hidden';
|
if (!isAudioAllowed) initAudioButton.className = 'hidden';
|
||||||
@@ -1313,7 +1319,6 @@ async function getRoomParticipants(refresh = false) {
|
|||||||
participantsCount = peers.size;
|
participantsCount = peers.size;
|
||||||
roomParticipants.innerHTML = table;
|
roomParticipants.innerHTML = table;
|
||||||
refreshParticipantsCount(participantsCount);
|
refreshParticipantsCount(participantsCount);
|
||||||
setTableButtonsTippy();
|
|
||||||
|
|
||||||
if (!refresh) {
|
if (!refresh) {
|
||||||
toggleParticipants();
|
toggleParticipants();
|
||||||
@@ -1381,15 +1386,6 @@ async function getParticipantsTable(peers) {
|
|||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTableButtonsTippy() {
|
|
||||||
if (!DetectRTC.isMobileDevice) {
|
|
||||||
setTippy('muteAllButton', 'Mute all participants', 'top');
|
|
||||||
setTippy('hideAllButton', 'Hide all participants', 'top');
|
|
||||||
setTippy('sendAllButton', 'Send file to all participants', 'top');
|
|
||||||
setTippy('ejectAllButton', 'Eject all participants', 'top');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function refreshParticipantsCount(count) {
|
function refreshParticipantsCount(count) {
|
||||||
participantsTitle.innerHTML = `<i class="fas fa-users"></i> Participants ( ${count} )`;
|
participantsTitle.innerHTML = `<i class="fas fa-users"></i> Participants ( ${count} )`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const image = {
|
|||||||
locked: '../images/locked.png',
|
locked: '../images/locked.png',
|
||||||
mute: '../images/mute.png',
|
mute: '../images/mute.png',
|
||||||
hide: '../images/hide.png',
|
hide: '../images/hide.png',
|
||||||
|
users: '../images/participants.png',
|
||||||
youtube: '../images/youtube.png',
|
youtube: '../images/youtube.png',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1076,7 +1077,7 @@ class RoomClient {
|
|||||||
this.sound('open');
|
this.sound('open');
|
||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
background: swalBackground,
|
background: swalBg,
|
||||||
position: 'center',
|
position: 'center',
|
||||||
title: 'Leave this room?',
|
title: 'Leave this room?',
|
||||||
showDenyButton: true,
|
showDenyButton: true,
|
||||||
@@ -2183,6 +2184,13 @@ class RoomClient {
|
|||||||
peerAction(from_peer_name, id, action, emit = true, broadcast = false) {
|
peerAction(from_peer_name, id, action, emit = true, broadcast = false) {
|
||||||
let peer_id = id;
|
let peer_id = id;
|
||||||
if (emit) {
|
if (emit) {
|
||||||
|
let data = {
|
||||||
|
from_peer_name: this.peer_name,
|
||||||
|
peer_id: peer_id,
|
||||||
|
action: action,
|
||||||
|
broadcast: broadcast,
|
||||||
|
};
|
||||||
|
|
||||||
if (!broadcast) {
|
if (!broadcast) {
|
||||||
if (participantsCount === 1) return;
|
if (participantsCount === 1) return;
|
||||||
|
|
||||||
@@ -2206,36 +2214,73 @@ class RoomClient {
|
|||||||
let peerVideoButton = this.getId(peer_id + '___pVideo');
|
let peerVideoButton = this.getId(peer_id + '___pVideo');
|
||||||
if (peerVideoButton) peerVideoButton.innerHTML = _PEER.videoOff;
|
if (peerVideoButton) peerVideoButton.innerHTML = _PEER.videoOff;
|
||||||
}
|
}
|
||||||
|
this.socket.emit('peerAction', data);
|
||||||
} else {
|
} else {
|
||||||
if (participantsCount === 1) return;
|
if (participantsCount === 1) return;
|
||||||
|
|
||||||
let actionButton = this.getId(action + 'AllButton');
|
|
||||||
if (actionButton) actionButton.style.display = 'none';
|
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'eject':
|
case 'eject':
|
||||||
|
Swal.fire({
|
||||||
|
background: swalBackground,
|
||||||
|
position: 'center',
|
||||||
|
imageUrl: image.users,
|
||||||
|
title: 'Eject All participants except yourself?',
|
||||||
|
showDenyButton: true,
|
||||||
|
confirmButtonText: `Yes`,
|
||||||
|
denyButtonText: `No`,
|
||||||
|
showClass: {
|
||||||
|
popup: 'animate__animated animate__fadeInDown',
|
||||||
|
},
|
||||||
|
hideClass: {
|
||||||
|
popup: 'animate__animated animate__fadeOutUp',
|
||||||
|
},
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
let actionButton = this.getId(action + 'AllButton');
|
||||||
|
if (actionButton) actionButton.style.display = 'none';
|
||||||
participantsCount = 1;
|
participantsCount = 1;
|
||||||
refreshParticipantsCount(participantsCount);
|
refreshParticipantsCount(participantsCount);
|
||||||
|
this.socket.emit('peerAction', data);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getRoomParticipants(true);
|
getRoomParticipants(true);
|
||||||
}, 6000);
|
}, 6000);
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case 'mute':
|
case 'mute':
|
||||||
case 'hide':
|
case 'hide':
|
||||||
|
Swal.fire({
|
||||||
|
background: swalBackground,
|
||||||
|
position: 'center',
|
||||||
|
imageUrl: action == 'mute' ? image.mute : image.hide,
|
||||||
|
title:
|
||||||
|
action == 'mute' ? 'Mute everyone except yourself?' : 'Hide everyone except yourself?',
|
||||||
|
text:
|
||||||
|
action == 'mute'
|
||||||
|
? "Once muted, you won't be able to unmute them, but they can unmute themselves at any time."
|
||||||
|
: "Once hided, you won't be able to unhide them, but they can unhide themselves at any time.",
|
||||||
|
showDenyButton: true,
|
||||||
|
confirmButtonText: `Yes`,
|
||||||
|
denyButtonText: `No`,
|
||||||
|
showClass: {
|
||||||
|
popup: 'animate__animated animate__fadeInDown',
|
||||||
|
},
|
||||||
|
hideClass: {
|
||||||
|
popup: 'animate__animated animate__fadeOutUp',
|
||||||
|
},
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
let actionButton = this.getId(action + 'AllButton');
|
||||||
|
if (actionButton) actionButton.style.display = 'none';
|
||||||
|
this.socket.emit('peerAction', data);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getRoomParticipants(true);
|
getRoomParticipants(true);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = {
|
|
||||||
from_peer_name: this.peer_name,
|
|
||||||
peer_id: peer_id,
|
|
||||||
action: action,
|
|
||||||
broadcast: broadcast,
|
|
||||||
};
|
|
||||||
this.socket.emit('peerAction', data);
|
|
||||||
} else {
|
} else {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'eject':
|
case 'eject':
|
||||||
|
|||||||
@@ -203,8 +203,7 @@ access to use this app.
|
|||||||
<p>About</p>
|
<p>About</p>
|
||||||
</button>
|
</button>
|
||||||
<br />
|
<br />
|
||||||
<button id="sessionTime"></button>
|
<p id="sessionTime"></p>
|
||||||
<br />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="tabRecording" class="tabcontent">
|
<div id="tabRecording" class="tabcontent">
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم