mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-17 13:45:01 +00:00
fix: Fix issue with receiving sharing state
In some circumstances, the sharing state can be retrieved prior to participants or meeting info being populated. In those cases, Essentials is now creating an empty meeting object if one doesn't exist, and populating host info with None if no host has been indicated yet.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
@@ -464,18 +465,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
private void SetUpCallFeedbackActions()
|
private void SetUpCallFeedbackActions()
|
||||||
{
|
{
|
||||||
Status.Call.Sharing.PropertyChanged += (o, a) =>
|
Status.Call.Sharing.PropertyChanged += HandleSharingStateUpdate;
|
||||||
{
|
|
||||||
if (a.PropertyName == "State")
|
|
||||||
{
|
|
||||||
SharingContentIsOnFeedback.FireUpdate();
|
|
||||||
ReceivingContent.FireUpdate();
|
|
||||||
|
|
||||||
// Update the share status of the meeting info
|
|
||||||
var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host.Name, MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting);
|
|
||||||
MeetingInfo = meetingInfo;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Status.Call.PropertyChanged += (o, a) =>
|
Status.Call.PropertyChanged += (o, a) =>
|
||||||
{
|
{
|
||||||
@@ -487,6 +477,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleSharingStateUpdate(object sender, PropertyChangedEventArgs a)
|
||||||
|
{
|
||||||
|
if (a.PropertyName != "State")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SharingContentIsOnFeedback.FireUpdate();
|
||||||
|
ReceivingContent.FireUpdate();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
// Update the share status of the meeting info
|
||||||
|
if (MeetingInfo == null)
|
||||||
|
{
|
||||||
|
var sharingStatus = GetSharingStatus();
|
||||||
|
|
||||||
|
MeetingInfo = new MeetingInfo("", "", "", "", sharingStatus, GetIsHostMyself(), true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host != null ? Participants.Host.Name : "None",
|
||||||
|
MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting);
|
||||||
|
MeetingInfo = meetingInfo;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Error processing state property update. {0}", e.Message);
|
||||||
|
Debug.Console(2, this, e.StackTrace);
|
||||||
|
MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Subscribes to the PropertyChanged events on the state objects and fires the corresponding feedbacks.
|
/// Subscribes to the PropertyChanged events on the state objects and fires the corresponding feedbacks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1614,7 +1637,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Error Deserializing feedback: {0}", ex);
|
Debug.Console(1, this, "Error Deserializing feedback: {0}", ex.Message);
|
||||||
|
Debug.Console(2, this, "{0}", ex);
|
||||||
|
|
||||||
|
if (ex.InnerException != null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this,"Error Deserializing feedback inner exception: {0}", ex.InnerException.Message);
|
||||||
|
Debug.Console(2, this, "{0}", ex.InnerException.StackTrace);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1822,6 +1852,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
string sharingState = "None";
|
string sharingState = "None";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
if (Status.Call.Sharing.State == zEvent.eSharingState.Receiving)
|
if (Status.Call.Sharing.State == zEvent.eSharingState.Receiving)
|
||||||
{
|
{
|
||||||
sharingState = "Receiving Content";
|
sharingState = "Receiving Content";
|
||||||
@@ -1841,12 +1873,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
return sharingState;
|
return sharingState;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Exception getting sharing status: {0}", e.Message);
|
||||||
|
Debug.Console(2, this, "{0}", e.StackTrace);
|
||||||
|
return sharingState;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Will return true if the host is myself (this zoom room)
|
/// Will return true if the host is myself (this zoom room)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private bool GetIsHostMyself()
|
private bool GetIsHostMyself()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (Participants.CurrentParticipants.Count == 0)
|
if (Participants.CurrentParticipants.Count == 0)
|
||||||
{
|
{
|
||||||
@@ -1864,6 +1905,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
Debug.Console(2, this, "Host is: '{0}' IsMyself?: {1}", host.Name, host.IsMyself);
|
Debug.Console(2, this, "Host is: '{0}' IsMyself?: {1}", host.Name, host.IsMyself);
|
||||||
return host.IsMyself;
|
return host.IsMyself;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Exception getting isHost: {0}", e.Message);
|
||||||
|
Debug.Console(2, "{0}", e.StackTrace);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void StartSharing()
|
public override void StartSharing()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user