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

عرض الملف

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