mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 05:49:22 +00:00
Can hide local stream
This commit is contained in:
parent
c1053b8041
commit
fe2a6c2dfe
@ -30,6 +30,7 @@
|
|||||||
.call-window .call-window-body{
|
.call-window .call-window-body{
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
max-height: calc(100% - 62px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -85,6 +86,7 @@
|
|||||||
.call-window .streams-target video {
|
.call-window .streams-target video {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,6 +37,11 @@ ComunicWeb.components.calls.callWindow = {
|
|||||||
*/
|
*/
|
||||||
localStream: undefined,
|
localStream: undefined,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {HTMLVideoElement}
|
||||||
|
*/
|
||||||
|
localStreamVideo: undefined,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {SignalExchangerClient}
|
* @type {SignalExchangerClient}
|
||||||
*/
|
*/
|
||||||
@ -118,6 +123,27 @@ ComunicWeb.components.calls.callWindow = {
|
|||||||
call.localStream.getVideoTracks()[0].enabled = enabled;
|
call.localStream.getVideoTracks()[0].enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set local stream video visibility
|
||||||
|
*
|
||||||
|
* @param {Boolean} visible TRUE to make it visible / FALSE else
|
||||||
|
*/
|
||||||
|
call.setLocalStreamVisibility = function(visible){
|
||||||
|
if(call.localStreamVideo)
|
||||||
|
call.localStreamVideo.style.display = visible ? "block" : "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get local stream visibility
|
||||||
|
*
|
||||||
|
* @return {Boolean} TRUE if local stream is visible / FALSE else
|
||||||
|
*/
|
||||||
|
call.isLocalStreamVisible = function(){
|
||||||
|
if(!call.localStreamVideo)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return call.localStreamVideo.style.display !== "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -280,6 +306,16 @@ ComunicWeb.components.calls.callWindow = {
|
|||||||
|
|
||||||
var buttonsList = [
|
var buttonsList = [
|
||||||
|
|
||||||
|
//Show current user camera
|
||||||
|
{
|
||||||
|
icon: "fa-eye",
|
||||||
|
selected: true,
|
||||||
|
onclick: function(btn){
|
||||||
|
call.setLocalStreamVisibility(!call.isLocalStreamVisible());
|
||||||
|
togglButtonSelectedStatus(btn, call.isLocalStreamVisible());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//Mute button
|
//Mute button
|
||||||
{
|
{
|
||||||
icon: "fa-microphone",
|
icon: "fa-microphone",
|
||||||
@ -434,7 +470,7 @@ ComunicWeb.components.calls.callWindow = {
|
|||||||
ComunicWeb.components.calls.callWindow.initializeConnectionToSignalingServer(call);
|
ComunicWeb.components.calls.callWindow.initializeConnectionToSignalingServer(call);
|
||||||
|
|
||||||
//Add local stream to the list of visible stream
|
//Add local stream to the list of visible stream
|
||||||
ComunicWeb.components.calls.callWindow.addVideoStream(call, true, stream);
|
call.localStreamVideo = ComunicWeb.components.calls.callWindow.addVideoStream(call, true, stream);
|
||||||
|
|
||||||
//Mark as connecting
|
//Mark as connecting
|
||||||
call.setLoadingMessage("Connecting...");
|
call.setLoadingMessage("Connecting...");
|
||||||
|
Loading…
Reference in New Issue
Block a user