예제 #1
0
 private void CheckAuxVideoPersonChange(CallMembership leftPerson)
 {
     if (AuxStreams != null && AuxStreams.Count > 0)
     {
         foreach (var item in AuxStreams)
         {
             if (item.IsInUse && item.Person.PersonId == leftPerson.PersonId)
             {
                 SdkLogger.Instance.Debug($"{item.Track} change to no person.");
                 var oldperson = item.Person;
                 item.person  = null;
                 item.IsInUse = false;
                 TrigerOnAuxStreamEvent(new AuxStreamPersonChangedEvent(oldperson, item.Person, this, item));
             }
         }
     }
 }
예제 #2
0
 internal void TrigerOnCallMembershipChanged(CallMembershipChangedEvent callMembershipEvent)
 {
     SdkLogger.Instance.Info($"event[{callMembershipEvent.GetType().Name}] callmembership[{callMembershipEvent.CallMembership.Email}]");
     if (callMembershipEvent is CallMembershipJoinedEvent joinedEvent &&
         JoinedCallMembershipCount == 2 && ActiveSpeaker == null)
     {
         activeSpeaker = joinedEvent.CallMembership;
         TrigerOnMediaChanged(new ActiveSpeakerChangedEvent(this, activeSpeaker, null));
     }
     if (callMembershipEvent is CallMembershipLeftEvent leftEvent)
     {
         CheckAuxVideoPersonChange(leftEvent.CallMembership);
         if (JoinedCallMembershipCount < 2 && ActiveSpeaker != null)
         {
             var oldperson = ActiveSpeaker;
             activeSpeaker = null;
             TrigerOnMediaChanged(new ActiveSpeakerChangedEvent(this, null, oldperson));
         }
     }
     OnCallMembershipChanged?.Invoke(callMembershipEvent);
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CallMembershipChangedEvent"/> class.
 /// </summary>
 /// <param name="call">current call instance.</param>
 /// <param name="callMembership">This callmembership.</param>
 /// <remarks>Since: 0.1.0</remarks>
 protected CallMembershipChangedEvent(Call call, CallMembership callMembership)
     : base(call)
 {
     this.callMembership = callMembership;
 }
 internal AuxStreamPersonChangedEvent(CallMembership oldperson, CallMembership newperson, Call call, AuxStream remoteAuxVideo)
     : base(call, remoteAuxVideo)
 {
     FromPerson = oldperson;
     ToPerson   = newperson;
 }
예제 #5
0
 internal CallMembershipSendingShareEvent(Call call, CallMembership callMembership)
     : base(call, callMembership)
 {
 }
예제 #6
0
 internal CallMembershipSendingAudioEvent(Call call, CallMembership callMembership)
     : base(call, callMembership)
 {
 }
예제 #7
0
 internal CallMembershipDeclinedEvent(Call call, CallMembership callMembership)
     : base(call, callMembership)
 {
 }
예제 #8
0
 internal CallMembershipLeftEvent(Call call, CallMembership callMembership)
     : base(call, callMembership)
 {
 }
예제 #9
0
 internal ActiveSpeakerChangedEvent(Call call, CallMembership activeSpeaker, CallMembership oldperson)
     : base(call)
 {
     FromPerson = oldperson;
     ToPerson   = activeSpeaker;
 }