Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed large room parameter in room object #1682

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading