mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 13:59:23 +00:00
Improve method
This commit is contained in:
parent
40ef78acc6
commit
ce89facd2d
@ -673,14 +673,13 @@ class CallWindow extends CustomEvents {
|
|||||||
*/
|
*/
|
||||||
async startStreaming(includeVideo, shareScreen = false) {
|
async startStreaming(includeVideo, shareScreen = false) {
|
||||||
|
|
||||||
let videoConstraints = this.conv.can_have_video_call && includeVideo;
|
|
||||||
|
|
||||||
let stream;
|
let stream;
|
||||||
|
|
||||||
// Get user screen
|
// Get user screen
|
||||||
if(includeVideo && shareScreen) {
|
if(includeVideo && shareScreen) {
|
||||||
stream = await requestUserScreen(true)
|
stream = await requestUserScreen(true)
|
||||||
|
|
||||||
|
// Ask for audio separatly
|
||||||
const second_stream = await navigator.mediaDevices.getUserMedia({
|
const second_stream = await navigator.mediaDevices.getUserMedia({
|
||||||
audio: true
|
audio: true
|
||||||
})
|
})
|
||||||
@ -692,7 +691,7 @@ class CallWindow extends CustomEvents {
|
|||||||
else {
|
else {
|
||||||
// First, query user media
|
// First, query user media
|
||||||
stream = await navigator.mediaDevices.getUserMedia({
|
stream = await navigator.mediaDevices.getUserMedia({
|
||||||
video: videoConstraints,
|
video: this.conv.can_have_video_call && includeVideo,
|
||||||
audio: true,
|
audio: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user