Commit ff110ec9 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Juliusz Chroboczek

remove button control to mute/unmute my video

parent 0bc81291
...@@ -1026,8 +1026,8 @@ function setMedia(c, isUp) { ...@@ -1026,8 +1026,8 @@ function setMedia(c, isUp) {
controls = /** @type{HTMLElement} */(template.cloneNode(true)); controls = /** @type{HTMLElement} */(template.cloneNode(true));
controls.id = 'controls-' + c.id; controls.id = 'controls-' + c.id;
div.appendChild(controls); div.appendChild(controls);
if(media.muted) {
let volume = controls.querySelector(".fa-volume-up"); let volume = controls.querySelector(".fa-volume-up");
if(media.muted) {
if (volume) { if (volume) {
volume.classList.remove("fa-volume-up"); volume.classList.remove("fa-volume-up");
volume.classList.add("fa-volume-off"); volume.classList.add("fa-volume-off");
...@@ -1039,6 +1039,7 @@ function setMedia(c, isUp) { ...@@ -1039,6 +1039,7 @@ function setMedia(c, isUp) {
if (camera) if (camera)
camera.classList.add("camera-off"); camera.classList.add("camera-off");
} }
volume.parentElement.remove();
} else } else
camera.remove(); camera.remove();
} }
...@@ -1087,7 +1088,9 @@ function registerControlEvent(peerid) { ...@@ -1087,7 +1088,9 @@ function registerControlEvent(peerid) {
let settings = getSettings(); let settings = getSettings();
let peer = document.getElementById(peerid); let peer = document.getElementById(peerid);
//Add event listener when a video component is added to the DOM //Add event listener when a video component is added to the DOM
peer.querySelector("span.volume").onclick = function(event) { let volume = /** @type {HTMLElement} */(peer.querySelector("span.volume"));
if (volume) {
volume.onclick = function(event) {
event.preventDefault(); event.preventDefault();
let video = getParentVideo(event.target); let video = getParentVideo(event.target);
if(event.target.className.indexOf("fa-volume-off") !== -1) { if(event.target.className.indexOf("fa-volume-off") !== -1) {
...@@ -1101,6 +1104,7 @@ function registerControlEvent(peerid) { ...@@ -1101,6 +1104,7 @@ function registerControlEvent(peerid) {
video.muted = true; video.muted = true;
} }
}; };
}
let pip = /** @type {HTMLElement} */(peer.querySelector("span.pip")); let pip = /** @type {HTMLElement} */(peer.querySelector("span.pip"));
/** @ts-ignore */ /** @ts-ignore */
......
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