Skip to content

Commit

Permalink
Merge pull request #158 from AgoraIO-Community/active-speaker-fix
Browse files Browse the repository at this point in the history
Disable Active Speaker when overrided
  • Loading branch information
tadaspetra committed Sep 28, 2023
2 parents 1d4cf87 + 89aabe4 commit 7da5a92
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.7
- Fixes active speaker bug when user overrides with manual pin
- Updates permission_handler to v11.0.0

## 1.3.6

- Fixes error [[#151](https://github.com/AgoraIO-Community/VideoUIKit-Flutter/issues/151)
Expand Down
5 changes: 5 additions & 0 deletions lib/controllers/session_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ class SessionController extends ValueNotifier<AgoraSettings> {
}
}

/// Function to disableActiveSpeaker
void setActiveSpeakerDisabled(bool activeSpeakerDisabled) {
value = value.copyWith(isActiveSpeakerDisabled: activeSpeakerDisabled);
}

/// Function to swap [AgoraUser] in the floating layout.
void swapUser({required int index}) {
final AgoraUser newUser = value.users[index];
Expand Down
2 changes: 1 addition & 1 deletion lib/models/agora_rtm_mute_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class AgoraUIKit {
String platform = platformStr();

String framework = "flutter";
String version = "1.3.6";
String version = "1.3.7";

AgoraUIKit.fromJson(Map<String, dynamic> json)
: platform = json['platform'],
Expand Down
12 changes: 12 additions & 0 deletions lib/src/layout/floating_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ class _FloatingLayoutState extends State<FloatingLayout> {
8),
child: GestureDetector(
onTap: () {
widget.client
.sessionController
.setActiveSpeakerDisabled(
false);
widget.client
.sessionController
.swapUser(
Expand Down Expand Up @@ -238,6 +242,10 @@ class _FloatingLayoutState extends State<FloatingLayout> {
child:
GestureDetector(
onTap: () {
widget.client
.sessionController
.setActiveSpeakerDisabled(
true);
widget.client
.sessionController
.swapUser(
Expand Down Expand Up @@ -353,6 +361,10 @@ class _FloatingLayoutState extends State<FloatingLayout> {
child:
GestureDetector(
onTap: () {
widget.client
.sessionController
.setActiveSpeakerDisabled(
true);
widget.client
.sessionController
.swapUser(
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: agora_uikit
description: Flutter plugin to simply integrate Agora Video Calling or Live
Video Streaming to your app with just a few lines of code.
version: 1.3.6
version: 1.3.7
homepage: https://www.agora.io/en/
repository: https://github.com/AgoraIO-Community/VideoUIKit-Flutter

Expand All @@ -14,9 +14,9 @@ dependencies:
agora_rtm: ^1.5.5
flutter:
sdk: flutter
http: '>=0.13.1 <2.0.0'
lints: ">=1.0.1 <2.1.0"
permission_handler: ^10.2.0
http: ">=0.13.1 <2.0.0"
lints: ">=1.0.1 <2.1.2"
permission_handler: ^11.0.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 7da5a92

Please sign in to comment.