Skip to content

Commit

Permalink
Updated skip preview implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Dec 20, 2023
1 parent 5298ca9 commit 5ac8169
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 109 deletions.
80 changes: 36 additions & 44 deletions packages/hms_room_kit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.17.2"
convert:
dependency: transitive
description:
Expand All @@ -77,10 +77,10 @@ packages:
dependency: transitive
description:
name: cross_file
sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e
sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5"
url: "https://pub.dev"
source: hosted
version: "0.3.3+8"
version: "0.3.3+7"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -227,10 +227,10 @@ packages:
dependency: transitive
description:
name: http
sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139
sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.0"
http_parser:
dependency: transitive
description:
Expand Down Expand Up @@ -299,10 +299,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.9.1"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -387,58 +387,50 @@ packages:
dependency: transitive
description:
name: permission_handler
sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78"
sha256: "284a66179cabdf942f838543e10413246f06424d960c92ba95c84439154fcac8"
url: "https://pub.dev"
source: hosted
version: "11.1.0"
version: "11.0.1"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6"
sha256: f9fddd3b46109bd69ff3f9efa5006d2d309b7aec0f3c1c5637a60a2d5659e76e
url: "https://pub.dev"
source: hosted
version: "12.0.1"
version: "11.1.0"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306"
url: "https://pub.dev"
source: hosted
version: "9.2.0"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "11b762a8c123dced6461933a88ea1edbbe036078c3f9f41b08886e678e7864df"
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5"
url: "https://pub.dev"
source: hosted
version: "0.1.0+2"
version: "9.1.4"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1
sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "3.12.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004"
sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.1.3"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
url: "https://pub.dev"
source: hosted
version: "6.0.2"
version: "5.4.0"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -531,10 +523,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_web
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.1"
shared_preferences_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -568,18 +560,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
Expand All @@ -600,10 +592,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.0"
tuple:
dependency: transitive
description:
Expand Down Expand Up @@ -672,10 +664,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: "7286aec002c8feecc338cc33269e96b73955ab227456e9fb2a91f7fab8a358e9"
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -736,10 +728,10 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.1.4-beta"
win32:
dependency: transitive
description:
Expand All @@ -760,10 +752,10 @@ packages:
dependency: transitive
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
url: "https://pub.dev"
source: hosted
version: "6.5.0"
version: "6.3.0"
sdks:
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
7 changes: 7 additions & 0 deletions packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class HMSRoomLayout {
static bool isParticipantsListEnabled = true;
static bool isBRBEnabled = true;

Check failure on line 218 in packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart

View workflow job for this annotation

GitHub Actions / vale

[vale] packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart#L218

[Vale.Spelling] Did you really mean 'isBRBEnabled'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'isBRBEnabled'?", "location": {"path": "packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart", "range": {"start": {"line": 218, "column": 15}}}, "severity": "ERROR"}
static List<String>? offStageRoles = [];
static bool skipPreviewForRole = false;

static Future<void> getRoomLayout(
{required HMSSDKInteractor hmsSDKInteractor,
Expand Down Expand Up @@ -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

Check failure on line 271 in packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart

View workflow job for this annotation

GitHub Actions / vale

[vale] packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart#L271

[Vale.Spelling] Did you really mean 'chatData'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'chatData'?", "location": {"path": "packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart", "range": {"start": {"line": 271, "column": 7}}}, "severity": "ERROR"}
?.screens?.conferencing?.hlsLiveStreaming?.elements?.chat;
Expand All @@ -274,6 +278,9 @@ class HMSRoomLayout {
null;
offStageRoles = roleLayoutData?.screens?.conferencing?.hlsLiveStreaming
?.elements?.onStageExp?.offStageRoles;
skipPreviewForRole = roleLayoutData?.screens?.conferencing?.hlsLiveStreaming
?.elements?.onStageExp?.skipPreviewForRoleChange ??
false;
}
}

Expand Down
27 changes: 8 additions & 19 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ class MeetingStore extends ChangeNotifier
hmsActionResultListener: this);
}

void setPreviousRole(String oldRole) {

Check failure on line 473 in packages/hms_room_kit/lib/src/meeting/meeting_store.dart

View workflow job for this annotation

GitHub Actions / vale

[vale] packages/hms_room_kit/lib/src/meeting/meeting_store.dart#L473

[Vale.Spelling] Did you really mean 'oldRole'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'oldRole'?", "location": {"path": "packages/hms_room_kit/lib/src/meeting/meeting_store.dart", "range": {"start": {"line": 473, "column": 31}}}, "severity": "ERROR"}
if (HMSRoomLayout.skipPreviewForRole) {
_hmsSDKInteractor.changeMetadata(
metadata: "{\"isBRBOn\":false,\"prevRole\":\"$oldRole\"}",

Check failure on line 476 in packages/hms_room_kit/lib/src/meeting/meeting_store.dart

View workflow job for this annotation

GitHub Actions / vale

[vale] packages/hms_room_kit/lib/src/meeting/meeting_store.dart#L476

[Vale.Spelling] Did you really mean 'oldRole'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'oldRole'?", "location": {"path": "packages/hms_room_kit/lib/src/meeting/meeting_store.dart", "range": {"start": {"line": 476, "column": 57}}}, "severity": "ERROR"}

Check failure on line 476 in packages/hms_room_kit/lib/src/meeting/meeting_store.dart

View workflow job for this annotation

GitHub Actions / vale

[vale] packages/hms_room_kit/lib/src/meeting/meeting_store.dart#L476

[Google.Quotes] Commas and periods go inside quotation marks.
Raw output
{"message": "[Google.Quotes] Commas and periods go inside quotation marks.", "location": {"path": "packages/hms_room_kit/lib/src/meeting/meeting_store.dart", "range": {"start": {"line": 476, "column": 65}}}, "severity": "ERROR"}
hmsActionResultListener: this);
}
}

Future<List<HMSRole>> getRoles() async {
return await _hmsSDKInteractor.getRoles();
}
Expand Down Expand Up @@ -513,25 +521,6 @@ class MeetingStore extends ChangeNotifier
return false;
}

bool shouldSkipPreviewForRoleChange() {
if (HMSRoomLayout.peerType == PeerRoleType.conferencing) {
return HMSRoomLayout.roleLayoutData?.screens?.conferencing?.defaultConf
?.elements?.onStageExp?.skipPreviewForRoleChange ??
false;
} else if (HMSRoomLayout.peerType == PeerRoleType.hlsViewer) {
return HMSRoomLayout
.roleLayoutData
?.screens
?.conferencing
?.hlsLiveStreaming
?.elements
?.onStageExp
?.skipPreviewForRoleChange ??
false;
}
return false;
}

void changeTrackState(HMSTrack track, bool mute) {
return _hmsSDKInteractor.changeTrackState(track, mute, this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ class _ParticipantsBottomSheetState extends State<ParticipantsBottomSheet> {
peer: peer,
roleName: onStageRole,
forceChange:
meetingStore.shouldSkipPreviewForRoleChange());
HMSRoomLayout.skipPreviewForRole);
meetingStore.setPreviousRole(peer.role.name);
meetingStore.removeToast(HMSToastsType.roleChangeToast,
data: peer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ class _ParticipantsViewAllBottomSheetState
peer: peer,
roleName: onStageRole,
forceChange:
meetingStore.shouldSkipPreviewForRoleChange());
HMSRoomLayout.skipPreviewForRole);
meetingStore.setPreviousRole(peer.role.name);
meetingStore.removeToast(HMSToastsType.roleChangeToast,
data: peer);
}
Expand Down
Loading

0 comments on commit 5ac8169

Please sign in to comment.