From 76712fe609792d718d18112c2f60592a9075df8a Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Fri, 22 Dec 2023 18:42:36 +0530 Subject: [PATCH] Exposed large room parameter in room object --- .../bottom_sheets/participants_bottom_sheet.dart | 11 ++++++++--- .../live/hms/hmssdk_flutter/HMSRoomExtension.kt | 2 ++ .../ios/Classes/Models/HMSRoomExtension.swift | 3 ++- packages/hmssdk_flutter/lib/src/model/hms_room.dart | 3 +++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart index 7d2f70b23..4aca9a14a 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_bottom_sheet.dart @@ -33,12 +33,17 @@ class ParticipantsBottomSheet extends StatefulWidget { class _ParticipantsBottomSheetState extends State { Timer? timer; + bool isLargeRoom = false; @override void initState() { super.initState(); - timer = Timer.periodic(const Duration(seconds: 5), - (Timer t) => context.read().refreshPeerList()); + + isLargeRoom = context.read().hmsRoom?.isLarge ?? false; + if (isLargeRoom) { + timer = Timer.periodic(const Duration(seconds: 5), + (Timer t) => context.read().refreshPeerList()); + } } @override @@ -389,7 +394,7 @@ class _ParticipantsBottomSheetState extends State { .onSurfaceHighEmphasis, title: HMSSubheadingText( text: - "${context.read().participantsInMeetingMap.keys.elementAt(index)} (${(HMSRoomLayout.offStageRoles?.contains(role) ?? false) ? context.read().peerListIterators[role]?.totalCount ?? 0 : participantsPerRole.item1}) ", + "${context.read().participantsInMeetingMap.keys.elementAt(index)} (${((HMSRoomLayout.offStageRoles?.contains(role) ?? false) && isLargeRoom) ? context.read().peerListIterators[role]?.totalCount ?? 0 : participantsPerRole.item1}) ", textColor: HMSThemeColors .onSurfaceMediumEmphasis, letterSpacing: 0.1, diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSRoomExtension.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSRoomExtension.kt index d3522c237..bebd5bd78 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSRoomExtension.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSRoomExtension.kt @@ -17,6 +17,8 @@ class HMSRoomExtension { room.peerList.forEach { args.add(HMSPeerExtension.toDictionary(it)!!) } + + hashMap["is_large"] = room.isLargeRoom hashMap["local_peer"] = HMSPeerExtension.toDictionary(room.localPeer) hashMap["peers"] = args hashMap["rtmp_streaming_state"] = HMSStreamingState.toDictionary(room.rtmpHMSRtmpStreamingState) diff --git a/packages/hmssdk_flutter/ios/Classes/Models/HMSRoomExtension.swift b/packages/hmssdk_flutter/ios/Classes/Models/HMSRoomExtension.swift index 183c18650..cad828eb2 100644 --- a/packages/hmssdk_flutter/ios/Classes/Models/HMSRoomExtension.swift +++ b/packages/hmssdk_flutter/ios/Classes/Models/HMSRoomExtension.swift @@ -17,7 +17,7 @@ class HMSRoomExtension { if let roomID = room.roomID { dict["id"] = roomID } - + if let name = room.name { dict["name"] = name } @@ -34,6 +34,7 @@ class HMSRoomExtension { dict["peer_count"] = peerCount } + dict["is_large"] = room.isLarge var peers = [[String: Any]]() room.peers.forEach { peers.append(HMSPeerExtension.toDictionary($0)) } dict["peers"] = peers diff --git a/packages/hmssdk_flutter/lib/src/model/hms_room.dart b/packages/hmssdk_flutter/lib/src/model/hms_room.dart index 38132cc6e..3671372d0 100644 --- a/packages/hmssdk_flutter/lib/src/model/hms_room.dart +++ b/packages/hmssdk_flutter/lib/src/model/hms_room.dart @@ -21,6 +21,7 @@ class HMSRoom { String id; String? name; String? metaData; + bool isLarge; HMSBrowserRecordingState? hmsBrowserRecordingState; HMSRtmpStreamingState? hmsRtmpStreamingState; HMSServerRecordingState? hmsServerRecordingState; @@ -37,6 +38,7 @@ class HMSRoom { {required this.id, this.name, required this.peers, + required this.isLarge, this.metaData, this.hmsServerRecordingState, this.hmsRtmpStreamingState, @@ -76,6 +78,7 @@ class HMSRoom { hmshlsRecordingState: map["hls_recording_state"] != null ? HMSHLSRecordingState.fromMap(map["hls_recording_state"] as Map) : null, + isLarge: map["is_large"], id: map['id'], name: map['name'], peers: peers,