From 08f4d8e9a2a285c1d656a9fc6d62a2408a26d859 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 9 Jun 2021 16:57:42 -0600 Subject: [PATCH] Attempts to unpin participant from same screenIndex if one is already pinned. --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 556c9d85..a6b8c469 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 @@ -2113,6 +2113,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public void PinParticipant(int userId, int screenIndex) { + // Try to see if anyone is already pinned to this screen + var pinnedParticipant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(screenIndex)); + + if (pinnedParticipant != null) + { + // If we find a participant already pinned, unpin this one and clear the feedback values + UnPinParticipant(pinnedParticipant.UserId); + pinnedParticipant.IsPinnedFb = false; + pinnedParticipant.ScreenIndexIsPinnedToFb = -1; + } + SendText(string.Format("zCommand Call Pin Id: {0} Enable: on Screen: {1}", userId, screenIndex)); }