Update server

This commit is contained in:
Sergiu Toma 2022-11-29 04:03:06 +02:00
parent a21451e46d
commit d17b035526
2 changed files with 76 additions and 30 deletions

View File

@ -20529,22 +20529,45 @@ const getLocalStream = () => {
console.log('🟨 [PERMISSION] onchange', this.state);
if (this.state === 'granted') {
doIHaveAudio = true;
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
} else if (this.state === 'denied') {
doIHaveAudio = false;
navigator.mediaDevices.getUserMedia({
audio: false,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
}
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then((streamSuccess) => {
return streamSuccess
})
.catch(error => {
console.log(error.message)
})
// navigator.mediaDevices.getUserMedia({
// audio: true,
// video: {
// qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
// vga : { width: { ideal: 640 }, height: { ideal: 480 } },
// hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
// }
// })
// .then(streamSuccess)
// .catch(error => {
// console.log(error.message)
// })
}
})

View File

@ -171,22 +171,45 @@ const getLocalStream = () => {
console.log('🟨 [PERMISSION] onchange', this.state);
if (this.state === 'granted') {
doIHaveAudio = true;
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
} else if (this.state === 'denied') {
doIHaveAudio = false;
navigator.mediaDevices.getUserMedia({
audio: false,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
}
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then((streamSuccess) => {
return streamSuccess
})
.catch(error => {
console.log(error.message)
})
// navigator.mediaDevices.getUserMedia({
// audio: true,
// video: {
// qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
// vga : { width: { ideal: 640 }, height: { ideal: 480 } },
// hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
// }
// })
// .then(streamSuccess)
// .catch(error => {
// console.log(error.message)
// })
}
})