Apply video policy

This commit is contained in:
Pierre HUBERT 2020-04-12 17:45:10 +02:00
parent 3b2c533233
commit 143e0a0c87

View File

@ -283,14 +283,15 @@ class CallWindow extends CustomEvents {
} }
/** /**
* Add video stream to the user * Add audio / video stream to the user
* *
* @param {number} peerID Remove peer ID * @param {number} peerID Remove peer ID
* @param {boolean} muted True to mute video * @param {boolean} muted True to mute video
* @param {MediaStream} stream Target stream * @param {MediaStream} stream Target stream
*/ */
addVideoStream(peerID, muted, stream) { addVideoStream(peerID, muted, stream) {
const videoEl = document.createElement("video");
const videoEl = document.createElement(stream.getVideoTracks().length > 0 ? "video" : "audio");
this.videosArea.appendChild(videoEl) this.videosArea.appendChild(videoEl)
videoEl.muted = muted; videoEl.muted = muted;
@ -325,7 +326,7 @@ class CallWindow extends CustomEvents {
// First, query user media // First, query user media
const stream = await navigator.mediaDevices.getUserMedia({ const stream = await navigator.mediaDevices.getUserMedia({
video: true, video: this.conv.can_have_video_call,
audio: true audio: true
}) })