Skip to content

Commit

Permalink
Exposed large room parameter in room object (#1682)
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 authored Dec 22, 2023
1 parent b9c92a7 commit 8e0bc03
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ class ParticipantsBottomSheet extends StatefulWidget {

class _ParticipantsBottomSheetState extends State<ParticipantsBottomSheet> {
Timer? timer;
bool isLargeRoom = false;

@override
void initState() {
super.initState();
timer = Timer.periodic(const Duration(seconds: 5),
(Timer t) => context.read<MeetingStore>().refreshPeerList());

isLargeRoom = context.read<MeetingStore>().hmsRoom?.isLarge ?? false;
if (isLargeRoom) {
timer = Timer.periodic(const Duration(seconds: 5),
(Timer t) => context.read<MeetingStore>().refreshPeerList());
}
}

@override
Expand Down Expand Up @@ -389,7 +394,7 @@ class _ParticipantsBottomSheetState extends State<ParticipantsBottomSheet> {
.onSurfaceHighEmphasis,
title: HMSSubheadingText(
text:
"${context.read<MeetingStore>().participantsInMeetingMap.keys.elementAt(index)} (${(HMSRoomLayout.offStageRoles?.contains(role) ?? false) ? context.read<MeetingStore>().peerListIterators[role]?.totalCount ?? 0 : participantsPerRole.item1}) ",
"${context.read<MeetingStore>().participantsInMeetingMap.keys.elementAt(index)} (${((HMSRoomLayout.offStageRoles?.contains(role) ?? false) && isLargeRoom) ? context.read<MeetingStore>().peerListIterators[role]?.totalCount ?? 0 : participantsPerRole.item1}) ",
textColor: HMSThemeColors
.onSurfaceMediumEmphasis,
letterSpacing: 0.1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HMSRoomExtension {
if let roomID = room.roomID {
dict["id"] = roomID
}

if let name = room.name {
dict["name"] = name
}
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions packages/hmssdk_flutter/lib/src/model/hms_room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class HMSRoom {
String id;
String? name;
String? metaData;
bool isLarge;
HMSBrowserRecordingState? hmsBrowserRecordingState;
HMSRtmpStreamingState? hmsRtmpStreamingState;
HMSServerRecordingState? hmsServerRecordingState;
Expand All @@ -37,6 +38,7 @@ class HMSRoom {
{required this.id,
this.name,
required this.peers,
required this.isLarge,
this.metaData,
this.hmsServerRecordingState,
this.hmsRtmpStreamingState,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8e0bc03

Please sign in to comment.