diff --git a/.github/styles/Vocab/HMSVocab/accept.txt b/.github/styles/Vocab/HMSVocab/accept.txt index 1068092e2..fc81c8bf7 100644 --- a/.github/styles/Vocab/HMSVocab/accept.txt +++ b/.github/styles/Vocab/HMSVocab/accept.txt @@ -175,6 +175,15 @@ iOS authToken issue_tracker publish_to +bool +prominentRoles +isOverlay +roleName +forceChange +previousRole +peerMetadata +toRole +forPeer Enum rolesWhitelist messagePlaceholder @@ -184,4 +193,4 @@ bool permission_handler intl chatState -pinnedMessages \ No newline at end of file +pinnedMessages diff --git a/packages/hms_room_kit/lib/src/layout_api/hms_conferencing_items.dart b/packages/hms_room_kit/lib/src/layout_api/hms_conferencing_items.dart index a65f761f4..9c630c695 100644 --- a/packages/hms_room_kit/lib/src/layout_api/hms_conferencing_items.dart +++ b/packages/hms_room_kit/lib/src/layout_api/hms_conferencing_items.dart @@ -140,12 +140,14 @@ class OnStageExp { String? removeFromStageLabel; String? onStageRole; List? offStageRoles; + bool? skipPreviewForRoleChange; OnStageExp({ this.bringToStageLabel, this.removeFromStageLabel, this.onStageRole, this.offStageRoles, + this.skipPreviewForRoleChange, }); OnStageExp.fromJson(Map? json) { @@ -154,6 +156,7 @@ class OnStageExp { removeFromStageLabel = null; onStageRole = null; offStageRoles = null; + skipPreviewForRoleChange = null; return; } bringToStageLabel = json['bring_to_stage_label']; @@ -163,6 +166,9 @@ class OnStageExp { json.containsKey('off_stage_roles') && json['off_stage_roles'] is List ? List.from(json['off_stage_roles']) : null; + skipPreviewForRoleChange = json.containsKey('skip_preview_for_role_change') + ? json['skip_preview_for_role_change'] + : null; } Map toJson() { @@ -173,6 +179,7 @@ class OnStageExp { if (offStageRoles != null && offStageRoles!.isNotEmpty) { data['off_stage_roles'] = offStageRoles; } + data['skip_preview_for_role_change'] = skipPreviewForRoleChange; return data; } } diff --git a/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart b/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart index 6394e0201..8265bd311 100644 --- a/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart +++ b/packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart @@ -217,6 +217,7 @@ class HMSRoomLayout { static bool isParticipantsListEnabled = true; static bool isBRBEnabled = true; static List? offStageRoles = []; + static bool skipPreviewForRole = false; static Future getRoomLayout( {required HMSSDKInteractor hmsSDKInteractor, @@ -263,6 +264,9 @@ class HMSRoomLayout { null; offStageRoles = roleLayoutData?.screens?.conferencing?.defaultConf ?.elements?.onStageExp?.offStageRoles; + skipPreviewForRole = roleLayoutData?.screens?.conferencing?.defaultConf + ?.elements?.onStageExp?.skipPreviewForRoleChange ?? + false; } else { chatData = roleLayoutData ?.screens?.conferencing?.hlsLiveStreaming?.elements?.chat; @@ -274,6 +278,14 @@ class HMSRoomLayout { null; offStageRoles = roleLayoutData?.screens?.conferencing?.hlsLiveStreaming ?.elements?.onStageExp?.offStageRoles; + skipPreviewForRole = roleLayoutData + ?.screens + ?.conferencing + ?.hlsLiveStreaming + ?.elements + ?.onStageExp + ?.skipPreviewForRoleChange ?? + false; } } diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index d07490878..861641c8f 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -476,6 +476,14 @@ class MeetingStore extends ChangeNotifier hmsActionResultListener: this); } + void setPreviousRole(String oldRole) { + if (HMSRoomLayout.skipPreviewForRole) { + _hmsSDKInteractor.changeMetadata( + metadata: "{\"isBRBOn\":false,\"prevRole\":\"$oldRole\"}", + hmsActionResultListener: this); + } + } + Future> getRoles() async { return await _hmsSDKInteractor.getRoles(); } @@ -1403,6 +1411,8 @@ class MeetingStore extends ChangeNotifier participantsInMeetingMap[peer.role.name]?[index].updatePeer(peer); } notifyListeners(); + } else if (peerUpdate == HMSPeerUpdate.metadataChanged) { + participantsInMeetingMap[peer.role.name]?[index].updatePeer(peer); } } else { if (peerUpdate == HMSPeerUpdate.roleUpdated) { 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 858278a11..798daf327 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 @@ -138,7 +138,10 @@ class _ParticipantsBottomSheetState extends State { HMSRole? onStageRole = meetingStore.getOnStageRole(); if (onStageRole != null) { meetingStore.changeRoleOfPeer( - peer: peer, roleName: onStageRole, forceChange: false); + peer: peer, + roleName: onStageRole, + forceChange: HMSRoomLayout.skipPreviewForRole); + meetingStore.setPreviousRole(peer.role.name); meetingStore.removeToast(HMSToastsType.roleChangeToast, data: peer); } diff --git a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart index 2a0ecb79e..4a55f0b0c 100644 --- a/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart +++ b/packages/hms_room_kit/lib/src/widgets/bottom_sheets/participants_view_all_bottom_sheet.dart @@ -131,7 +131,10 @@ class _ParticipantsViewAllBottomSheetState HMSRole? onStageRole = meetingStore.getOnStageRole(); if (onStageRole != null) { meetingStore.changeRoleOfPeer( - peer: peer, roleName: onStageRole, forceChange: false); + peer: peer, + roleName: onStageRole, + forceChange: HMSRoomLayout.skipPreviewForRole); + meetingStore.setPreviousRole(peer.role.name); meetingStore.removeToast(HMSToastsType.roleChangeToast, data: peer); } diff --git a/packages/hmssdk_flutter/example/android/Gemfile.lock b/packages/hmssdk_flutter/example/android/Gemfile.lock index a8c843f4a..5c0424dfc 100644 --- a/packages/hmssdk_flutter/example/android/Gemfile.lock +++ b/packages/hmssdk_flutter/example/android/Gemfile.lock @@ -13,13 +13,13 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.867.0) + aws-partitions (1.869.0) aws-sdk-core (3.190.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.74.0) + aws-sdk-kms (1.75.0) aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.141.0) @@ -41,7 +41,7 @@ GEM domain_name (0.6.20231109) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.106.0) + excon (0.108.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -114,7 +114,7 @@ GEM fastlane-plugin-firebase_app_distribution (0.7.4) google-apis-firebaseappdistribution_v1 (~> 0.3.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.53.0) + google-apis-androidpublisher_v3 (0.54.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) @@ -198,7 +198,7 @@ GEM unicode-display_width (>= 1.1.1, < 3) trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.8.1) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) tzinfo (2.0.6) diff --git a/packages/hmssdk_flutter/example/ios/Gemfile.lock b/packages/hmssdk_flutter/example/ios/Gemfile.lock index bddaabd61..301551d57 100644 --- a/packages/hmssdk_flutter/example/ios/Gemfile.lock +++ b/packages/hmssdk_flutter/example/ios/Gemfile.lock @@ -13,13 +13,13 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.867.0) + aws-partitions (1.869.0) aws-sdk-core (3.190.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.74.0) + aws-sdk-kms (1.75.0) aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.141.0) @@ -41,7 +41,7 @@ GEM domain_name (0.6.20231109) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.106.0) + excon (0.108.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -115,7 +115,7 @@ GEM google-apis-firebaseappdistribution_v1 (~> 0.3.0) fastlane-plugin-versioning (0.5.2) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.53.0) + google-apis-androidpublisher_v3 (0.54.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) @@ -199,7 +199,7 @@ GEM unicode-display_width (>= 1.1.1, < 3) trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.8.1) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) tzinfo (2.0.6)