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

Release 1.9.11: Develop to main #1718

Merged
merged 45 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
10dfbff
Added leaderboard in flutter
Decoder07 Feb 20, 2024
5540740
Added leaderboard changes
Decoder07 Feb 21, 2024
1349e59
released sample app version 1.5.142 (442) 🍀
Decoder07 Feb 21, 2024
82bf6a7
Added timer in quiz
Decoder07 Feb 22, 2024
cf85f29
released sample app version 1.5.143 (443) 🍀
ygit Feb 22, 2024
203ec81
added check to not show hide vote count in case of quiz
Decoder07 Feb 23, 2024
d0c1ee3
Added check for hide vote count in case of quiz
Decoder07 Feb 23, 2024
cfed1c8
Updated package version
Decoder07 Feb 23, 2024
e67c7ae
🤖 Automated Format and Fix
Decoder07 Feb 23, 2024
915df90
Added fetchPollList method
Decoder07 Feb 23, 2024
11c6563
Added fetchPollList method
Decoder07 Feb 23, 2024
525961e
Fixed view option
Decoder07 Feb 23, 2024
9ceca25
🤖 Automated Format and Fix
Decoder07 Feb 23, 2024
7b28772
Fixed bugs
Decoder07 Feb 25, 2024
d16114a
🤖 Automated Format and Fix
Decoder07 Feb 25, 2024
e4df614
Fixed leaderboard bugs
Decoder07 Feb 26, 2024
6fd941b
🤖 Automated Format and Fix
Decoder07 Feb 26, 2024
9c0ed3d
released sample app version 1.5.146 (446) 🍀
Decoder07 Feb 26, 2024
579cb41
🤖 Automated Format and Fix
Decoder07 Feb 26, 2024
8a93119
Updated sdk versions
Decoder07 Feb 26, 2024
9dffb6c
🤖 Automated Format and Fix
Decoder07 Feb 26, 2024
2db4444
Merge pull request #1716 from 100mslive/FLUT-234
Decoder07 Feb 26, 2024
f90f293
Updated changelog
Decoder07 Feb 26, 2024
6b0a728
Fixed timed metadata issue
Decoder07 Feb 26, 2024
d5c2a71
Updated pubspec
Decoder07 Feb 26, 2024
0294998
🤖 Automated Format and Fix
Decoder07 Feb 26, 2024
ea624ba
updated changelog
Decoder07 Feb 26, 2024
8044d1a
updated gemfile
Decoder07 Feb 26, 2024
2cd9b0c
released sample app version 1.5.147 (447) 🍀
Decoder07 Feb 26, 2024
f8b45ad
Fixed leaderboard ui bug
Decoder07 Feb 26, 2024
65d1dfa
🤖 Automated Format and Fix
Decoder07 Feb 26, 2024
657d061
released sample app version 1.5.148 (448) 🍀
Decoder07 Feb 26, 2024
f683f1e
Merge pull request #1717 from 100mslive/FLUT-247/timed-metadata-fix
Decoder07 Feb 26, 2024
dbcbc03
Updated native sdk versions
Decoder07 Feb 26, 2024
9a249f4
Updated changelog
Decoder07 Feb 26, 2024
d10bc8d
Fixed lints
Decoder07 Feb 26, 2024
531d96f
Merge branch 'main' into develop
ygit Feb 26, 2024
3d6b65e
Updated app changelog
Decoder07 Feb 26, 2024
12393d0
resolved lint warnings
ygit Feb 26, 2024
efada99
🤖 Automated Format and Fix
ygit Feb 26, 2024
d702e59
Updated pubspec
Decoder07 Feb 26, 2024
9182cd1
🤖 Automated Format and Fix
Decoder07 Feb 26, 2024
e682f8f
Removed unused asset
Decoder07 Feb 26, 2024
f3b897d
Updated sdk version in room kit
Decoder07 Feb 26, 2024
184d708
🤖 Automated Format and Fix
Decoder07 Feb 26, 2024
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
15 changes: 15 additions & 0 deletions packages/hms_room_kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
| hms_room_kit | [![Pub Version](https://img.shields.io/pub/v/hms_room_kit)](https://pub.dev/packages/hms_room_kit) |
| hmssdk_flutter | [![Pub Version](https://img.shields.io/pub/v/hmssdk_flutter)](https://pub.dev/packages/hmssdk_flutter) |

## 1.0.14 - 2024-02-26

| Package | Version |
| -------------- | ------------------------------------------------------------------------------------------------------ |
| hms_room_kit | 1.0.14 |
| hmssdk_flutter | 1.9.11 |

### 🚀 Added

- Introducing leaderboards to our quiz experience

Adding leaderboard to our quizzes with leaderboard summary and rankings.

Updated `hmssdk_flutter` package version to 1.9.11

## 1.0.13 - 2024-02-16

| Package | Version |
Expand Down
6 changes: 3 additions & 3 deletions packages/hms_room_kit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.13"
version: "1.0.14"
hmssdk_flutter:
dependency: transitive
description:
name: hmssdk_flutter
sha256: "4706d94dfd0136bf0bf2e8377cf0bd95a3d5e9edfa2a6a7c6b609c8a4bd6a16e"
sha256: "5dedf840502cf20f5d22f5718c9cf620c6694f73b48156cc17015ecde0237bb7"
url: "https://pub.dev"
source: hosted
version: "1.9.10"
version: "1.9.11"
http:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/hms_room_kit/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.13
version: 1.0.14

environment:
sdk: ">=2.19.6 <3.0.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/hms_room_kit/lib/src/assets/icons/tick_circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 32 additions & 4 deletions packages/hms_room_kit/lib/src/hmssdk_interactor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -424,27 +424,55 @@ class HMSSDKInteractor {
{required HMSPoll poll,
required HMSPollQuestion question,
required HMSPollQuestionOption pollQuestionOption,
HMSPeer? peer}) {
HMSPeer? peer,
Duration? timeTakenToAnswer}) {
return HMSPollInteractivityCenter.addSingleChoicePollResponse(
hmsPoll: poll,
pollQuestion: question,
optionSelected: pollQuestionOption,
peer: peer);
peer: peer,
timeTakenToAnswer: timeTakenToAnswer);
}

Future<dynamic> addMultiChoicePollResponse(
{required HMSPoll poll,
required HMSPollQuestion question,
required List<HMSPollQuestionOption> pollQuestionOption,
HMSPeer? peer}) {
HMSPeer? peer,
Duration? timeTakenToAnswer}) {
return HMSPollInteractivityCenter.addMultiChoicePollResponse(
hmsPoll: poll,
pollQuestion: question,
optionsSelected: pollQuestionOption,
peer: peer);
peer: peer,
timeTakenToAnswer: timeTakenToAnswer);
}

Future<dynamic> stopPoll({required HMSPoll poll}) {
return HMSPollInteractivityCenter.stopPoll(poll: poll);
}

Future<dynamic> fetchLeaderboard(
{required HMSPoll poll,
required int count,
required int startIndex,
required bool includeCurrentPeer}) {
return HMSPollInteractivityCenter.fetchLeaderboard(
poll: poll,
count: count,
startIndex: startIndex,
includeCurrentPeer: includeCurrentPeer);
}

Future<dynamic> fetchPollList({required HMSPollState hmsPollState}) {
return HMSPollInteractivityCenter.fetchPollList(hmsPollState: hmsPollState);
}

Future<dynamic> fetchPollQuestions({required HMSPoll hmsPoll}) {
return HMSPollInteractivityCenter.fetchPollQuestions(hmsPoll: hmsPoll);
}

Future<dynamic> getPollResults({required HMSPoll hmsPoll}) {
return HMSPollInteractivityCenter.getPollResults(hmsPoll: hmsPoll);
}
}
101 changes: 96 additions & 5 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ class MeetingStore extends ChangeNotifier

List<HMSPollStore> hlsViewerPolls = [];

///Cue Duration for hls stream
final int _hlsCueDuration = 20;

///List of bottom sheets currently open
List<BuildContext> bottomSheets = [];

Expand Down Expand Up @@ -893,6 +896,7 @@ class MeetingStore extends ChangeNotifier
getAudioDevicesList();
notifyListeners();
setViewControllers();
// fetchPollList(HMSPollState.stopped);
// if (Platform.isIOS &&
// HMSRoomLayout.roleLayoutData?.screens?.conferencing?.defaultConf !=
// null) {
Expand Down Expand Up @@ -2243,27 +2247,104 @@ class MeetingStore extends ChangeNotifier

///Method to add Poll Response
void addSingleChoicePollResponse(HMSPoll poll, HMSPollQuestion question,
HMSPollQuestionOption pollQuestionOption) {
HMSPollQuestionOption pollQuestionOption,
{Duration? timeTakenToAnswer}) {
_hmsSDKInteractor.addSingleChoicePollResponse(
poll: poll,
question: question,
pollQuestionOption: pollQuestionOption,
peer: localPeer);
peer: localPeer,
timeTakenToAnswer: timeTakenToAnswer);
}

void addMultiChoicePollResponse(HMSPoll poll, HMSPollQuestion question,
List<HMSPollQuestionOption> pollQuestionOption) {
List<HMSPollQuestionOption> pollQuestionOption,
{Duration? timeTakenToAnswer}) {
_hmsSDKInteractor.addMultiChoicePollResponse(
poll: poll,
question: question,
pollQuestionOption: pollQuestionOption,
peer: localPeer);
peer: localPeer,
timeTakenToAnswer: timeTakenToAnswer);
}

void stopPoll(HMSPoll poll) {
_hmsSDKInteractor.stopPoll(poll: poll);
}

void fetchLeaderboard(HMSPoll poll) async {
var data = await _hmsSDKInteractor.fetchLeaderboard(
poll: poll, count: 5, startIndex: 0, includeCurrentPeer: true);

if (data is HMSPollLeaderboardResponse) {
var pollIndex = pollQuestions
.indexWhere((element) => element.poll.pollId == poll.pollId);
if (pollIndex != -1) {
pollQuestions[pollIndex].updatePollLeaderboardResponse(data);
}
} else {
log("fetchLeaderboard error: $data");
}
notifyListeners();
}

// void fetchPollList(HMSPollState state) async {
// var data = await _hmsSDKInteractor.fetchPollList(hmsPollState: state);

// if (data is List<HMSPoll>) {
// for (var element in data) {
// pollQuestions.add(HMSPollStore(poll: element));
// }
// sortPollQuestions();
// } else {
// log("fetchPollList error: $data");
// }
// }

// void fetchPollQuestions(HMSPoll poll) async {
// var data = await _hmsSDKInteractor.fetchPollQuestions(hmsPoll: poll);

// if (data is List<HMSPollQuestion>) {
// int index = pollQuestions
// .indexWhere((element) => element.poll.pollId == poll.pollId);

// if (index != -1) {
// var newPoll = HMSPoll(
// pollId: poll.pollId,
// title: poll.title,
// anonymous: poll.anonymous,
// category: poll.category,
// createdBy: poll.createdBy,
// duration: poll.duration,
// pollUserTrackingMode: poll.pollUserTrackingMode,
// questionCount: data.length,
// questions: data,
// result: poll.result,
// rolesThatCanViewResponses: poll.rolesThatCanViewResponses,
// rolesThatCanVote: poll.rolesThatCanVote,
// startedAt: poll.startedAt,
// startedBy: poll.startedBy,
// state: poll.state,
// stoppedAt: poll.stoppedAt,
// stoppedBy: poll.stoppedBy);
// pollQuestions[index].updateState(newPoll);
// }
// }
// }

// void getPollResults(HMSPoll poll) async {
// var data = await _hmsSDKInteractor.getPollResults(hmsPoll: poll);

// if (data is HMSPoll) {
// int index = pollQuestions
// .indexWhere((element) => element.poll.pollId == poll.pollId);

// if (index != -1) {
// pollQuestions[index].updateState(data);
// }
// }
// }

//Get onSuccess or onException callbacks for HMSActionResultListenerMethod
@override
void onSuccess(
Expand Down Expand Up @@ -2697,6 +2778,13 @@ class MeetingStore extends ChangeNotifier
switch (pollUpdateType) {
///If the poll is started we add the poll in questions list
case HMSPollUpdateType.started:
if (poll.createdBy?.peerId == localPeer?.peerId) {
///Send timed metadata for polls/quiz created by local peer.
sendHLSTimedMetadata([
HMSHLSTimedMetadata(
metadata: "poll:${poll.pollId}", duration: _hlsCueDuration)
]);
}

/*
* Here we check whether the peer has permission to view polls
Expand Down Expand Up @@ -2726,7 +2814,7 @@ class MeetingStore extends ChangeNotifier
*/
if (poll.startedAt != null &&
(DateTime.now().difference(poll.startedAt!) >
const Duration(seconds: 20))) {
Duration(seconds: _hlsCueDuration))) {
insertPollQuestion(store);
toasts.add(HMSToastModel(store,
hmsToastType: HMSToastsType.pollStartedToast));
Expand All @@ -2749,6 +2837,9 @@ class MeetingStore extends ChangeNotifier
break;

case HMSPollUpdateType.stopped:
if (poll.category == HMSPollCategory.quiz) {
fetchLeaderboard(poll);
}
removeToast(HMSToastsType.pollStartedToast, data: poll.pollId);
int index = pollQuestions
.indexWhere((element) => element.poll.pollId == poll.pollId);
Expand Down
7 changes: 7 additions & 0 deletions packages/hms_room_kit/lib/src/model/poll_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart';
///without rebuilding the whole UI
class HMSPollStore extends ChangeNotifier {
HMSPoll poll;
HMSPollLeaderboardResponse? pollLeaderboardResponse;

HMSPollStore({required this.poll});

Expand All @@ -17,4 +18,10 @@ class HMSPollStore extends ChangeNotifier {
this.poll = poll;
notifyListeners();
}

void updatePollLeaderboardResponse(
HMSPollLeaderboardResponse pollLeaderboardResponse) {
this.pollLeaderboardResponse = pollLeaderboardResponse;
notifyListeners();
}
}
Loading