chore: Remove the previous room state listener method.

This commit is contained in:
cloudwebrtc 2022-08-08 22:54:08 +08:00
parent 9695a5ad10
commit 3f38a96d4f
1 changed files with 0 additions and 29 deletions

View File

@ -197,9 +197,6 @@ class GroupCall {
Timer? activeSpeakerLoopTimeout;
Timer? retryCallLoopTimeout;
Map<String, num> retryCallCounts = {};
final CachedStreamController<GroupCall> onGroupCallFeedsChanged =
CachedStreamController();
@ -430,8 +427,6 @@ class GroupCall {
onMemberStateChanged(stateEvent);
});
retryCallLoopTimeout = Timer.periodic(
Duration(milliseconds: retryCallInterval), onRetryCallLoop);
onActiveSpeakerLoop();
voip.currentGroupCID = groupCallId;
@ -467,8 +462,6 @@ class GroupCall {
activeSpeaker = null;
activeSpeakerLoopTimeout?.cancel();
retryCallCounts.clear();
retryCallLoopTimeout?.cancel();
_callSubscription?.cancel();
}
@ -876,24 +869,6 @@ class GroupCall {
return memberDevices[0];
}
/// Monitor member status and respond to mesh calls by regularly updating
/// the state event in the room
void onRetryCallLoop(Timer _) async {
final memberStateEvents =
await getStateEventsList(EventTypes.GroupCallMemberPrefix);
memberStateEvents.forEach((event) {
final memberId = event.senderId;
final existingCall =
calls.indexWhere((call) => call.remoteUser!.id == memberId) != -1;
final retryCallCount = retryCallCounts[memberId] ?? 0;
if (!existingCall && retryCallCount < 3) {
retryCallCounts[memberId] = retryCallCount + 1;
onMemberStateChanged(event);
}
});
}
CallSession? getCallByUserId(String userId) {
final value = calls.where((item) => item.remoteUser!.id == userId);
if (value.isNotEmpty) {
@ -1064,10 +1039,6 @@ class GroupCall {
call.isLocalVideoMuted != videoMuted) {
call.setLocalVideoMuted(videoMuted);
}
if (state == CallState.kConnected) {
retryCallCounts.remove(call.remoteUser!.id);
}
}
void onCallHangup(CallSession call) {