Commit 2d37ec98 authored by Alain Takoudjou's avatar Alain Takoudjou

Remove support for disable video stream

Remove code to disable my video camera and keep only audio stream.
parent 21361a87
......@@ -211,9 +211,6 @@
<span class="volume" title="Volume">
<i class="fas fa-volume-up" data-type="bt-volume" aria-hidden="true"></i>
</span>
<span class="camera" title="Camera">
<i class="fas fa-video" data-type="bt-camera" aria-hidden="true"></i>
</span>
<span class="pip" title="Picture In Picture">
<i class="fas fa-clone" data-type="bt-pip" aria-hidden="true"></i>
</span>
......
......@@ -767,19 +767,15 @@ async function setMaxVideoThroughput(c, bps) {
/**
* @param {string} [id]
* @param {boolean} [disableVideo]
*/
async function addLocalMedia(id, disableVideo) {
async function addLocalMedia(id) {
if(!getUserPass())
return;
let settings = getSettings();
let audio = settings.audio ? {deviceId: settings.audio} : false;
let video =
disableVideo ? false :
settings.video ? {deviceId: settings.video} :
false;
let video = settings.video ? {deviceId: settings.video} : false;
if(video) {
if(settings.blackboardMode) {
......@@ -1011,7 +1007,6 @@ function muteLocalTracks(mute) {
*/
function setMedia(c, isUp, video) {
let peersdiv = document.getElementById('peers');
let settings = getSettings();
let local_media;
for(let id in serverConnection.up) {
......@@ -1079,15 +1074,8 @@ function setMedia(c, isUp, video) {
volume.classList.add("fa-volume-off");
}
}
let camera = controls.querySelector("span.camera");
if (local_media && local_media.kind === "local") {
if (!settings.video) {
if (camera)
camera.classList.add("camera-off");
}
if (local_media && local_media.kind === "local")
volume.parentElement.remove();
} else
camera.remove();
}
media.srcObject = c.stream;
......@@ -1183,27 +1171,6 @@ function registerControlEvent(peerid) {
}
};
}
let camera = /** @type {HTMLElement} */(peer.querySelector("span.camera"));
if(camera) {
camera.onclick = function(event) {
event.preventDefault();
let camera = /** @type {HTMLElement} */(event.target);
let video = getParentVideo(camera);
let id = video.id.split("-")[1];
if(!settings.video)
return;
if(camera.getAttribute("data-type") === "bt-camera") {
addLocalMedia(id, true);
camera.setAttribute("data-type", "bt-camera-off");
camera.parentElement.classList.add("disabled");
} else {
camera.setAttribute("data-type", "bt-camera");
camera.parentElement.classList.remove("disabled");
addLocalMedia(id);
}
};
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment