no video to start
parent
64b5d092a4
commit
ea0cb96a24
|
|
@ -86,7 +86,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
noiseSuppression: false,
|
noiseSuppression: false,
|
||||||
video: {
|
video: eVideoOptions.value === 'none' ? false : {
|
||||||
deviceId: {
|
deviceId: {
|
||||||
exact: eVideoOptions.value
|
exact: eVideoOptions.value
|
||||||
}
|
}
|
||||||
|
|
@ -107,9 +107,18 @@
|
||||||
call.peerConnection.getSenders()
|
call.peerConnection.getSenders()
|
||||||
.filter(sender => sender.track.kind === 'audio')[0]
|
.filter(sender => sender.track.kind === 'audio')[0]
|
||||||
.replaceTrack(audioTrack);
|
.replaceTrack(audioTrack);
|
||||||
call.peerConnection.getSenders()
|
|
||||||
.filter(sender => sender.track.kind === 'video')[0]
|
const currentVideoTrack = call.peerConnection.getSenders()
|
||||||
.replaceTrack(videoTrack);
|
.filter(sender => sender.track.kind === 'video')[0];
|
||||||
|
|
||||||
|
console.log(videoTrack, currentVideoTrack);
|
||||||
|
|
||||||
|
if(videoTrack !== undefined && currentVideoTrack === undefined) {
|
||||||
|
call.peerConnection.addTrack(videoTrack);
|
||||||
|
} else {
|
||||||
|
currentVideoTrack.replaceTrack(videoTrack);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,6 +144,13 @@
|
||||||
eAudioOptions.appendChild(elem);
|
eAudioOptions.appendChild(elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eVideoOptions.appendChild((function () {
|
||||||
|
const elem = document.createElement('option');
|
||||||
|
elem.innerText = "None";
|
||||||
|
elem.value = "none";
|
||||||
|
return elem;
|
||||||
|
})());
|
||||||
|
|
||||||
for(const device of devices.filter(v => v.kind === 'videoinput')) {
|
for(const device of devices.filter(v => v.kind === 'videoinput')) {
|
||||||
const elem = document.createElement('option');
|
const elem = document.createElement('option');
|
||||||
elem.innerText = device.label;
|
elem.innerText = device.label;
|
||||||
|
|
|
||||||
Reference in New Issue