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)); } } } }
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); }
/// <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; }
internal CallMembershipSendingShareEvent(Call call, CallMembership callMembership) : base(call, callMembership) { }
internal CallMembershipSendingAudioEvent(Call call, CallMembership callMembership) : base(call, callMembership) { }
internal CallMembershipDeclinedEvent(Call call, CallMembership callMembership) : base(call, callMembership) { }
internal CallMembershipLeftEvent(Call call, CallMembership callMembership) : base(call, callMembership) { }
internal ActiveSpeakerChangedEvent(Call call, CallMembership activeSpeaker, CallMembership oldperson) : base(call) { FromPerson = oldperson; ToPerson = activeSpeaker; }