[mirotalksfu] - fix join without webcam

هذا الالتزام موجود في:
Miroslav Pejic
2021-11-13 23:32:20 +01:00
الأصل b8f07bb149
التزام d69430e2e7
2 ملفات معدلة مع 14 إضافات و16 حذوفات

عرض الملف

@@ -37,8 +37,6 @@ let isEnumerateDevices = false;
let isAudioAllowed = false; let isAudioAllowed = false;
let isVideoAllowed = false; let isVideoAllowed = false;
let isAudioOn = true;
let isVideoOn = true;
let initAudioButton = null; let initAudioButton = null;
let initVideoButton = null; let initVideoButton = null;
@@ -220,8 +218,8 @@ function getPeerInfo() {
browser_version: DetectRTC.browser.version, browser_version: DetectRTC.browser.version,
peer_id: socket.id, peer_id: socket.id,
peer_name: peer_name, peer_name: peer_name,
peer_audio: isAudioOn, peer_audio: isAudioAllowed,
peer_video: isVideoOn, peer_video: isVideoAllowed,
peer_hand: false, peer_hand: false,
}; };
} }
@@ -282,17 +280,17 @@ function whoAreYou() {
} }
function handleAudio(e) { function handleAudio(e) {
isAudioOn = isAudioOn ? false : true; isAudioAllowed = isAudioAllowed ? false : true;
e.target.className = 'fas fa-microphone' + (isAudioOn ? '' : '-slash'); e.target.className = 'fas fa-microphone' + (isAudioAllowed ? '' : '-slash');
setColor(e.target, isAudioOn ? 'white' : 'red'); setColor(e.target, isAudioAllowed ? 'white' : 'red');
setColor(startAudioButton, isAudioOn ? 'white' : 'red'); setColor(startAudioButton, isAudioAllowed ? 'white' : 'red');
} }
function handleVideo(e) { function handleVideo(e) {
isVideoOn = isVideoOn ? false : true; isVideoAllowed = isVideoAllowed ? false : true;
e.target.className = 'fas fa-video' + (isVideoOn ? '' : '-slash'); e.target.className = 'fas fa-video' + (isVideoAllowed ? '' : '-slash');
setColor(e.target, isVideoOn ? 'white' : 'red'); setColor(e.target, isVideoAllowed ? 'white' : 'red');
setColor(startVideoButton, isVideoOn ? 'white' : 'red'); setColor(startVideoButton, isVideoAllowed ? 'white' : 'red');
} }
// #################################################### // ####################################################
@@ -441,8 +439,8 @@ function roomIsReady() {
} }
show(settingsButton); show(settingsButton);
show(raiseHandButton); show(raiseHandButton);
if (isAudioAllowed) show(startAudioButton); isAudioAllowed ? show(stopAudioButton) : show(startAudioButton);
if (isVideoAllowed) show(startVideoButton); isVideoAllowed ? show(stopVideoButton) : show(startVideoButton);
show(fileShareButton); show(fileShareButton);
show(participantsButton); show(participantsButton);
show(lockRoomButton); show(lockRoomButton);

عرض الملف

@@ -519,13 +519,13 @@ class RoomClient {
// #################################################### // ####################################################
startLocalMedia() { startLocalMedia() {
if (this.isAudioAllowed && this.peer_info.peer_audio) { if (this.isAudioAllowed) {
console.log('08 ----> Start audio media'); console.log('08 ----> Start audio media');
this.produce(mediaType.audio, microphoneSelect.value); this.produce(mediaType.audio, microphoneSelect.value);
} else { } else {
setColor(startAudioButton, 'red'); setColor(startAudioButton, 'red');
} }
if (this.isVideoAllowed && this.peer_info.peer_video) { if (this.isVideoAllowed) {
console.log('09 ----> Start video media'); console.log('09 ----> Start video media');
this.produce(mediaType.video, videoSelect.value); this.produce(mediaType.video, videoSelect.value);
} else { } else {