mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 05:49:22 +00:00
Can toggle camera visibility
This commit is contained in:
parent
4095ae5653
commit
2429ea2ad8
@ -109,6 +109,15 @@ class CallWindow extends CustomEvents {
|
|||||||
// Display the list of buttons
|
// Display the list of buttons
|
||||||
const buttonsList = [
|
const buttonsList = [
|
||||||
|
|
||||||
|
// Toggle current user camera
|
||||||
|
{
|
||||||
|
icon: "fa-eye",
|
||||||
|
selected: true,
|
||||||
|
onclick: (btn) => {
|
||||||
|
setButtonSelected(btn, this.toggleMainStreamVisibility())
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Audio button
|
// Audio button
|
||||||
{
|
{
|
||||||
icon: "fa-microphone",
|
icon: "fa-microphone",
|
||||||
@ -475,6 +484,30 @@ class CallWindow extends CustomEvents {
|
|||||||
this.refreshButtonsState()
|
this.refreshButtonsState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle current peer stream visibility
|
||||||
|
*
|
||||||
|
* @return {boolean} New state
|
||||||
|
*/
|
||||||
|
toggleMainStreamVisibility() {
|
||||||
|
const el = this.videoEls.get(userID())
|
||||||
|
|
||||||
|
if(!el || el.nodeName !== "VIDEO")
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Show again element
|
||||||
|
if(el.parentNode.style.display == "none") {
|
||||||
|
el.parentNode.style.display = ""
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide element
|
||||||
|
else {
|
||||||
|
el.parentNode.style.display = "none"
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add audio / video stream to the user
|
* Add audio / video stream to the user
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user