From 8af7b4b1dba6ec064dbd5415fa35ffdeaba752bb Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 30 Aug 2021 17:48:37 -0600 Subject: [PATCH] feat(essentials): Adds IsHost property to MeetingInfo to determine if the room is the host --- .../VC/EssentialsVideoCodecUiDriver.cs | 1 + .../VideoCodec/Interfaces/IHasMeetingInfo.cs | 5 +++- .../VideoCodec/Interfaces/IHasParticipants.cs | 1 + .../VideoCodec/ZoomRoom/ResponseObjects.cs | 1 + .../VideoCodec/ZoomRoom/ZoomRoom.cs | 26 ++++++++++++++++--- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 326ea1f5..ac0611d6 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -152,6 +152,7 @@ namespace PepperDash.Essentials.UIDrivers.VC // Return formatted when dialing, straight digits when in call DialStringFeedback = new StringFeedback(() => { + // Format the number feedback if in dial mode and the codec is not IHasStartMeeting (ZoomRoom) if (KeypadMode == eKeypadMode.Dial && !(Codec is IHasStartMeeting)) return GetFormattedDialString(DialStringBuilder.ToString()); else diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs index 4f1744b9..b49733ad 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs @@ -34,14 +34,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces public string Password { get; private set; } [JsonProperty("shareStatus")] public string ShareStatus { get; private set; } + [JsonProperty("isHost")] + public Boolean IsHost { get; private set; } - public MeetingInfo(string id, string name, string host, string password, string shareStatus) + public MeetingInfo(string id, string name, string host, string password, string shareStatus, bool isHost) { Id = id; Name = name; Host = host; Password = password; ShareStatus = shareStatus; + IsHost = IsHost; } } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs index 46b1391b..409ccd89 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs @@ -93,6 +93,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces { public int UserId { get; set; } public bool IsHost { get; set; } + public bool IsMyself { get; set; } public string Name { get; set; } public bool CanMuteVideo { get; set; } public bool CanUnmuteVideo { get; set; } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs index c42d7eee..aac45f51 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs @@ -1489,6 +1489,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom UserId = p.UserId, Name = p.UserName, IsHost = p.IsHost, + IsMyself = p.IsMyself, CanMuteVideo = p.IsVideoCanMuteByHost, CanUnmuteVideo = p.IsVideoCanUnmuteByHost, AudioMuteFb = p.AudioStatusState == "AUDIO_MUTED", diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index 0a12e25f..a51555df 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -472,7 +472,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom ReceivingContent.FireUpdate(); // Update the share status of the meeting info - var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host.Name, MeetingInfo.Password, GetSharingStatus()); + var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host.Name, MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself()); MeetingInfo = meetingInfo; } }; @@ -627,7 +627,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom case "isSharingBlackMagic": { // Update the share status of the meeting info - var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, MeetingInfo.Host, MeetingInfo.Password, GetSharingStatus()); + var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, MeetingInfo.Host, MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself()); MeetingInfo = meetingInfo; break; } @@ -1199,7 +1199,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom Participants.CurrentParticipants = participants; // Update the share status of the meeting info - var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host.Name, MeetingInfo.Password, MeetingInfo.ShareStatus); + var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host.Name, MeetingInfo.Password, MeetingInfo.ShareStatus, GetIsHostMyself()); MeetingInfo = meetingInfo; PrintCurrentCallParticipants(); @@ -1784,7 +1784,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom Status.Call.Info.meeting_list_item.meetingName, host, Status.Call.Info.meeting_password, - GetSharingStatus() + GetSharingStatus(), + GetIsHostMyself() ); } @@ -1821,6 +1822,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom return sharingState; } + /// + /// Will return true if the host is myself (this zoom room) + /// + /// + private bool GetIsHostMyself() + { + var host = Participants.Host; + + if(host == null) + { + Debug.Console(2, this, "Host is currently null"); + return false; + } + Debug.Console(2, this, "Host is: {0} myself?: {1}", host.Name, host.IsMyself); + return host.IsMyself; + } + public override void StartSharing() { SendText("zCommand Call Sharing HDMI Start");