[mirotalksfu] - Fix raise hand + add mute-hide-eject all
هذا الالتزام موجود في:
@@ -493,10 +493,10 @@ function stopRecordingTimer() {
|
|||||||
|
|
||||||
function handleButtons() {
|
function handleButtons() {
|
||||||
openNavButton.onclick = () => {
|
openNavButton.onclick = () => {
|
||||||
openNav();
|
toggleNav();
|
||||||
};
|
};
|
||||||
closeNavButton.onclick = () => {
|
closeNavButton.onclick = () => {
|
||||||
closeNav();
|
toggleNav();
|
||||||
};
|
};
|
||||||
exitButton.onclick = () => {
|
exitButton.onclick = () => {
|
||||||
rc.exit();
|
rc.exit();
|
||||||
@@ -737,11 +737,7 @@ function handleRoomClientEvents() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openNav() {
|
function toggleNav() {
|
||||||
control.classList.toggle('show');
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeNav() {
|
|
||||||
control.classList.toggle('show');
|
control.classList.toggle('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -819,6 +815,17 @@ async function getParticipantsTable(peers) {
|
|||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
|
|
||||||
|
table += `
|
||||||
|
<tr>
|
||||||
|
<td>All</td>
|
||||||
|
<td><button id="muteAllButton" onclick="rc.peerAction('me','${rc.peer_id}','mute',true,true)">${_PEER.audioOff} Mute</button></td>
|
||||||
|
<td><button id="hideAllButton" onclick="rc.peerAction('me','${rc.peer_id}','hide',true,true)">${_PEER.videoOff} Hide</button></td>
|
||||||
|
<td></td>
|
||||||
|
<td><button id="ejectAllButton" onclick="rc.peerAction('me','${rc.peer_id}','eject',true,true)">${_PEER.ejectPeer} Eject</button></td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
|
||||||
for (let peer of Array.from(peers.keys())) {
|
for (let peer of Array.from(peers.keys())) {
|
||||||
let peer_info = peers.get(peer).peer_info;
|
let peer_info = peers.get(peer).peer_info;
|
||||||
let peer_name = '👤 ' + peer_info.peer_name;
|
let peer_name = '👤 ' + peer_info.peer_name;
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ class RoomClient {
|
|||||||
'peerAction',
|
'peerAction',
|
||||||
function (data) {
|
function (data) {
|
||||||
console.log('Peer action:', data);
|
console.log('Peer action:', data);
|
||||||
this.peerAction(data.from_peer_name, data.peer_id, data.action, false);
|
this.peerAction(data.from_peer_name, data.peer_id, data.action, false, data.broadcast);
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -640,6 +640,7 @@ class RoomClient {
|
|||||||
this.handleFS(elem.id);
|
this.handleFS(elem.id);
|
||||||
this.setTippy(elem.id, 'Full Screen', 'top-end');
|
this.setTippy(elem.id, 'Full Screen', 'top-end');
|
||||||
this.popupPeerInfo(p.id, this.peer_info);
|
this.popupPeerInfo(p.id, this.peer_info);
|
||||||
|
this.checkPeerInfoStatus(this.peer_info);
|
||||||
this.sound('joined');
|
this.sound('joined');
|
||||||
resizeVideoMedia();
|
resizeVideoMedia();
|
||||||
return elem;
|
return elem;
|
||||||
@@ -1466,21 +1467,40 @@ class RoomClient {
|
|||||||
let peer_id = id;
|
let peer_id = id;
|
||||||
|
|
||||||
if (emit) {
|
if (emit) {
|
||||||
const words = peer_id.split('__');
|
if (!broadcast) {
|
||||||
peer_id = words[0];
|
const words = peer_id.split('__');
|
||||||
|
peer_id = words[0];
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'eject':
|
case 'eject':
|
||||||
let peer = this.getId(peer_id);
|
let peer = this.getId(peer_id);
|
||||||
if (peer) peer.parentNode.removeChild(peer);
|
if (peer) peer.parentNode.removeChild(peer);
|
||||||
break;
|
break;
|
||||||
case 'mute':
|
case 'mute':
|
||||||
let peerAudioButton = this.getId(peer_id + '__audio');
|
let peerAudioButton = this.getId(peer_id + '__audio');
|
||||||
if (peerAudioButton) peerAudioButton.innerHTML = _PEER.audioOff;
|
if (peerAudioButton) peerAudioButton.innerHTML = _PEER.audioOff;
|
||||||
break;
|
break;
|
||||||
case 'hide':
|
case 'hide':
|
||||||
let peerVideoButton = this.getId(peer_id + '__video');
|
let peerVideoButton = this.getId(peer_id + '__video');
|
||||||
if (peerVideoButton) peerVideoButton.innerHTML = _PEER.videoOff;
|
if (peerVideoButton) peerVideoButton.innerHTML = _PEER.videoOff;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let actionButton = this.getId(action + 'AllButton');
|
||||||
|
if (actionButton) actionButton.style.display = 'none';
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case 'eject':
|
||||||
|
setTimeout(() => {
|
||||||
|
getRoomParticipants();
|
||||||
|
}, 6000);
|
||||||
|
break;
|
||||||
|
case 'mute':
|
||||||
|
case 'hide':
|
||||||
|
setTimeout(() => {
|
||||||
|
getRoomParticipants();
|
||||||
|
}, 2000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
@@ -1493,7 +1513,7 @@ class RoomClient {
|
|||||||
} else {
|
} else {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'eject':
|
case 'eject':
|
||||||
if (peer_id === this.peer_id) {
|
if (peer_id === this.peer_id || broadcast) {
|
||||||
this.sound(action);
|
this.sound(action);
|
||||||
let timerInterval;
|
let timerInterval;
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
@@ -1519,7 +1539,7 @@ class RoomClient {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'mute':
|
case 'mute':
|
||||||
if (peer_id === this.peer_id) {
|
if (peer_id === this.peer_id || broadcast) {
|
||||||
this.closeProducer(mediaType.audio);
|
this.closeProducer(mediaType.audio);
|
||||||
this.userLog(
|
this.userLog(
|
||||||
'warning',
|
'warning',
|
||||||
@@ -1530,7 +1550,7 @@ class RoomClient {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'hide':
|
case 'hide':
|
||||||
if (peer_id === this.peer_id) {
|
if (peer_id === this.peer_id || broadcast) {
|
||||||
this.closeProducer(mediaType.video);
|
this.closeProducer(mediaType.video);
|
||||||
this.userLog(
|
this.userLog(
|
||||||
'warning',
|
'warning',
|
||||||
@@ -1562,11 +1582,11 @@ class RoomClient {
|
|||||||
this.peer_info.peer_hand = status;
|
this.peer_info.peer_hand = status;
|
||||||
let peer_hand = this.getId(peer_id + '__peerHand');
|
let peer_hand = this.getId(peer_id + '__peerHand');
|
||||||
if (status) {
|
if (status) {
|
||||||
peer_hand.style.display = 'flex';
|
if (peer_hand) peer_hand.style.display = 'flex';
|
||||||
this.event(_EVENTS.raiseHand);
|
this.event(_EVENTS.raiseHand);
|
||||||
this.sound('raiseHand');
|
this.sound('raiseHand');
|
||||||
} else {
|
} else {
|
||||||
peer_hand.style.display = 'none';
|
if (peer_hand) peer_hand.style.display = 'none';
|
||||||
this.event(_EVENTS.lowerHand);
|
this.event(_EVENTS.lowerHand);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1587,7 +1607,7 @@ class RoomClient {
|
|||||||
case 'hand':
|
case 'hand':
|
||||||
let peer_hand = this.getId(peer_id + '__peerHand');
|
let peer_hand = this.getId(peer_id + '__peerHand');
|
||||||
if (status) {
|
if (status) {
|
||||||
peer_hand.style.display = 'flex';
|
if (peer_hand) peer_hand.style.display = 'flex';
|
||||||
this.userLog(
|
this.userLog(
|
||||||
'warning',
|
'warning',
|
||||||
peer_name + ' ' + _PEER.raiseHand + ' has raised the hand',
|
peer_name + ' ' + _PEER.raiseHand + ' has raised the hand',
|
||||||
@@ -1596,7 +1616,7 @@ class RoomClient {
|
|||||||
);
|
);
|
||||||
this.sound('raiseHand');
|
this.sound('raiseHand');
|
||||||
} else {
|
} else {
|
||||||
peer_hand.style.display = 'none';
|
if (peer_hand) peer_hand.style.display = 'none';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1608,7 +1628,7 @@ class RoomClient {
|
|||||||
let peer_hand_status = peer_info.peer_hand;
|
let peer_hand_status = peer_info.peer_hand;
|
||||||
if (peer_hand_status) {
|
if (peer_hand_status) {
|
||||||
let peer_hand = this.getId(peer_id + '__peerHand');
|
let peer_hand = this.getId(peer_id + '__peerHand');
|
||||||
peer_hand.style.display = 'flex';
|
if (peer_hand) peer_hand.style.display = 'flex';
|
||||||
}
|
}
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم