[mirotalksfu] - Fix
هذا الالتزام موجود في:
@@ -606,20 +606,23 @@ function whoAreYou() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!BUTTONS.main.startVideoButton) {
|
if (!BUTTONS.main.startVideoButton) {
|
||||||
elemDisplay(document.getElementById('initVideoButton'), false);
|
isVideoAllowed = false;
|
||||||
elemDisplay(document.getElementById('initAudioVideoButton'), false);
|
elemDisplay('initVideo', false);
|
||||||
elemDisplay(document.getElementById('initVideoSelect'), false);
|
elemDisplay('initVideoButton', false);
|
||||||
elemDisplay(document.getElementById('tabVideoDevicesBtn'), false);
|
elemDisplay('initAudioVideoButton', false);
|
||||||
|
elemDisplay('initVideoSelect', false);
|
||||||
|
elemDisplay('tabVideoDevicesBtn', false);
|
||||||
}
|
}
|
||||||
if (!BUTTONS.main.startAudioButton) {
|
if (!BUTTONS.main.startAudioButton) {
|
||||||
elemDisplay(document.getElementById('initAudioButton'), false);
|
isAudioAllowed = false;
|
||||||
elemDisplay(document.getElementById('initAudioVideoButton'), false);
|
elemDisplay('initAudioButton', false);
|
||||||
elemDisplay(document.getElementById('initMicrophoneSelect'), false);
|
elemDisplay('initAudioVideoButton', false);
|
||||||
elemDisplay(document.getElementById('initSpeakerSelect'), false);
|
elemDisplay('initMicrophoneSelect', false);
|
||||||
elemDisplay(document.getElementById('tabAudioDevicesBtn'), false);
|
elemDisplay('initSpeakerSelect', false);
|
||||||
|
elemDisplay('tabAudioDevicesBtn', false);
|
||||||
}
|
}
|
||||||
if (!BUTTONS.main.startScreenButton) {
|
if (!BUTTONS.main.startScreenButton) {
|
||||||
elemDisplay(document.getElementById('initStartScreenButton'), false);
|
hide(initStartScreenButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('initUser').classList.toggle('hidden');
|
document.getElementById('initUser').classList.toggle('hidden');
|
||||||
@@ -650,14 +653,16 @@ function whoAreYou() {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (initStream && !joinRoomWithScreen) {
|
if (initStream && !joinRoomWithScreen) {
|
||||||
stopTracks(initStream);
|
stopTracks(initStream);
|
||||||
hide(initVideo);
|
// hide(initVideo);
|
||||||
|
elemDisplay('initVideo', false);
|
||||||
}
|
}
|
||||||
getPeerInfo();
|
getPeerInfo();
|
||||||
joinRoom(peer_name, room_id);
|
joinRoom(peer_name, room_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!isVideoAllowed) {
|
if (!isVideoAllowed) {
|
||||||
hide(initVideo);
|
// hide(initVideo);
|
||||||
|
elemDisplay('initVideo', false);
|
||||||
hide(initVideoSelect);
|
hide(initVideoSelect);
|
||||||
}
|
}
|
||||||
if (!isAudioAllowed) {
|
if (!isAudioAllowed) {
|
||||||
@@ -708,13 +713,14 @@ function handleAudioVideo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkInitVideo(isVideoAllowed) {
|
function checkInitVideo(isVideoAllowed) {
|
||||||
if (isVideoAllowed) {
|
if (isVideoAllowed && BUTTONS.main.startVideoButton) {
|
||||||
if (initVideoSelect.value) changeCamera(initVideoSelect.value);
|
if (initVideoSelect.value) changeCamera(initVideoSelect.value);
|
||||||
sound('joined');
|
sound('joined');
|
||||||
} else {
|
} else {
|
||||||
if (initStream) {
|
if (initStream) {
|
||||||
stopTracks(initStream);
|
stopTracks(initStream);
|
||||||
hide(initVideo);
|
// hide(initVideo);
|
||||||
|
elemDisplay('initVideo', false);
|
||||||
sound('left');
|
sound('left');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -741,6 +747,9 @@ function checkMedia() {
|
|||||||
let queryPeerVideo = video === '1' || video === 'true';
|
let queryPeerVideo = video === '1' || video === 'true';
|
||||||
if (queryPeerVideo != null) isVideoAllowed = queryPeerVideo;
|
if (queryPeerVideo != null) isVideoAllowed = queryPeerVideo;
|
||||||
}
|
}
|
||||||
|
elemDisplay('tabVideoDevicesBtn', isVideoAllowed);
|
||||||
|
elemDisplay('tabAudioDevicesBtn', isAudioAllowed);
|
||||||
|
|
||||||
console.log('Direct join', {
|
console.log('Direct join', {
|
||||||
audio: isAudioAllowed,
|
audio: isAudioAllowed,
|
||||||
video: isVideoAllowed,
|
video: isVideoAllowed,
|
||||||
@@ -969,7 +978,8 @@ function roomIsReady() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function elemDisplay(element, display, mode = 'block') {
|
function elemDisplay(element, display, mode = 'block') {
|
||||||
element.style.display = display ? mode : 'none';
|
const elem = document.getElementById(element);
|
||||||
|
elem ? (elem.style.display = display ? mode : 'none') : console.error('elemDisplay not found', element);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide(elem) {
|
function hide(elem) {
|
||||||
@@ -1387,7 +1397,8 @@ function setSelectsInit() {
|
|||||||
async function changeCamera(deviceId) {
|
async function changeCamera(deviceId) {
|
||||||
if (initStream) {
|
if (initStream) {
|
||||||
stopTracks(initStream);
|
stopTracks(initStream);
|
||||||
show(initVideo);
|
//show(initVideo);
|
||||||
|
elemDisplay('initVideo', true);
|
||||||
if (!initVideo.classList.contains('mirror')) {
|
if (!initVideo.classList.contains('mirror')) {
|
||||||
initVideo.classList.toggle('mirror');
|
initVideo.classList.toggle('mirror');
|
||||||
}
|
}
|
||||||
@@ -1427,13 +1438,17 @@ async function changeCamera(deviceId) {
|
|||||||
async function toggleScreenSharing() {
|
async function toggleScreenSharing() {
|
||||||
if (initStream) {
|
if (initStream) {
|
||||||
stopTracks(initStream);
|
stopTracks(initStream);
|
||||||
show(initVideo);
|
//show(initVideo);
|
||||||
|
elemDisplay('initVideo', true);
|
||||||
}
|
}
|
||||||
joinRoomWithScreen = !joinRoomWithScreen;
|
joinRoomWithScreen = !joinRoomWithScreen;
|
||||||
if (joinRoomWithScreen) {
|
if (joinRoomWithScreen) {
|
||||||
navigator.mediaDevices
|
navigator.mediaDevices
|
||||||
.getDisplayMedia({ audio: true, video: true })
|
.getDisplayMedia({ audio: true, video: true })
|
||||||
.then((screenStream) => {
|
.then((screenStream) => {
|
||||||
|
if (initVideo.classList.contains('mirror')) {
|
||||||
|
initVideo.classList.toggle('mirror');
|
||||||
|
}
|
||||||
initVideo.srcObject = screenStream;
|
initVideo.srcObject = screenStream;
|
||||||
initStream = screenStream;
|
initStream = screenStream;
|
||||||
console.log('04.6 ----> Success attached init screen video stream', initStream);
|
console.log('04.6 ----> Success attached init screen video stream', initStream);
|
||||||
@@ -2433,18 +2448,18 @@ function whiteboardAction(data, emit = true) {
|
|||||||
break;
|
break;
|
||||||
case 'lock':
|
case 'lock':
|
||||||
if (!isPresenter) {
|
if (!isPresenter) {
|
||||||
elemDisplay(whiteboardTitle, false);
|
elemDisplay('whiteboardTitle', false);
|
||||||
elemDisplay(whiteboardOptions, false);
|
elemDisplay('whiteboardOptions', false);
|
||||||
elemDisplay(whiteboardButton, false);
|
elemDisplay('whiteboardButton', false);
|
||||||
wbDrawing(false);
|
wbDrawing(false);
|
||||||
wbIsLock = true;
|
wbIsLock = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'unlock':
|
case 'unlock':
|
||||||
if (!isPresenter) {
|
if (!isPresenter) {
|
||||||
elemDisplay(whiteboardTitle, true, 'flex');
|
elemDisplay('whiteboardTitle', true, 'flex');
|
||||||
elemDisplay(whiteboardOptions, true, 'inline');
|
elemDisplay('whiteboardOptions', true, 'inline');
|
||||||
elemDisplay(whiteboardButton, true);
|
elemDisplay('whiteboardButton', true);
|
||||||
wbDrawing(true);
|
wbDrawing(true);
|
||||||
wbIsLock = false;
|
wbIsLock = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ function handleRules(isPresenter) {
|
|||||||
BUTTONS.settings.lobbyButton ? show(lobbyButton) : hide(lobbyButton);
|
BUTTONS.settings.lobbyButton ? show(lobbyButton) : hide(lobbyButton);
|
||||||
BUTTONS.participantsList.saveInfoButton ? show(participantsSaveBtn) : hide(participantsSaveBtn);
|
BUTTONS.participantsList.saveInfoButton ? show(participantsSaveBtn) : hide(participantsSaveBtn);
|
||||||
BUTTONS.whiteboard.whiteboardLockButton
|
BUTTONS.whiteboard.whiteboardLockButton
|
||||||
? elemDisplay(whiteboardLockButton, true)
|
? elemDisplay('whiteboardLockButton', true)
|
||||||
: elemDisplay(whiteboardLockButton, false, 'flex');
|
: elemDisplay('whiteboardLockButton', false, 'flex');
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم