Skip to content

Commit

Permalink
Sanity build fixes (#1640)
Browse files Browse the repository at this point in the history
* Updated android sdk version

* Added device selection in preview

* 🤖 Automated Format and Fix

* released sample app version 1.5.89 (389) 🍀

* updated dependencies

---------

Co-authored-by: Decoder07 <[email protected]>
Co-authored-by: ygit <[email protected]>
Co-authored-by: Yogesh Singh <[email protected]>
  • Loading branch information
4 people authored Nov 16, 2023
1 parent df6922c commit b505b85
Show file tree
Hide file tree
Showing 12 changed files with 347 additions and 169 deletions.
9 changes: 8 additions & 1 deletion packages/hms_room_kit/lib/src/meeting/meeting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ import 'package:hms_room_kit/src/widgets/toasts/hms_recording_error_toast.dart';
class MeetingPage extends StatefulWidget {
final String meetingLink;
final bool isRoomMute;
final HMSAudioDevice currentAudioDeviceMode;

const MeetingPage(
{Key? key, required this.meetingLink, this.isRoomMute = true})
{Key? key,
required this.meetingLink,
this.isRoomMute = true,
required this.currentAudioDeviceMode})
: super(key: key);

@override
Expand All @@ -65,6 +70,8 @@ class _MeetingPageState extends State<MeetingPage> {
context.read<MeetingStore>().toggleSpeaker();
});
}
context.read<MeetingStore>().currentAudioDeviceMode =
widget.currentAudioDeviceMode;
}

void _enableForegroundService() {
Expand Down
7 changes: 6 additions & 1 deletion packages/hms_room_kit/lib/src/meeting_screen_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class MeetingScreenController extends StatefulWidget {
///For more details checkout the [HMSConfig] class
final HMSConfig? config;

///[currentAudioDeviceMode] is the current audio device mode
final HMSAudioDevice currentAudioDeviceMode;

const MeetingScreenController(
{Key? key,
required this.roomCode,
Expand All @@ -52,7 +55,8 @@ class MeetingScreenController extends StatefulWidget {
this.showStats = false,
this.mirrorCamera = true,
this.role,
this.config})
this.config,
this.currentAudioDeviceMode = HMSAudioDevice.AUTOMATIC})
: super(key: key);

@override
Expand Down Expand Up @@ -95,6 +99,7 @@ class _MeetingScreenControllerState extends State<MeetingScreenController> {
return MeetingPage(
meetingLink: widget.roomCode,
isRoomMute: widget.isRoomMute,
currentAudioDeviceMode: widget.currentAudioDeviceMode,
);
},
selector: (_, meetingStore) => meetingStore.localPeer?.role.name);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
///Dart imports
import 'dart:io';

///Package imports
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
Expand Down Expand Up @@ -111,25 +108,17 @@ class PreviewBottomButtonSection extends StatelessWidget {
.contains("audio"))
HMSEmbeddedButton(
onTap: () {
///For iOS, This will open the native audio device selection UI
///
///For Android, it will open a bottom sheet
///with the list of available audio devices
if (Platform.isIOS) {
previewStore.switchAudioOutputUsingiOSUI();
} else {
showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
context: context,
builder: (ctx) => ChangeNotifierProvider.value(
value: previewStore,
child: const PreviewDeviceSettings()));
}
showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
context: context,
builder: (ctx) => ChangeNotifierProvider.value(
value: previewStore,
child: const PreviewDeviceSettings()));
},
isActive: true,
child: SvgPicture.asset(
'packages/hms_room_kit/lib/src/assets/icons/${Utilities.getAudioDeviceIconName(previewStore.currentAudioOutputDevice)}.svg',
'packages/hms_room_kit/lib/src/assets/icons/${previewStore.isRoomMute ? "speaker_state_off" : Utilities.getAudioDeviceIconName(previewStore.currentAudioOutputDevice)}.svg',
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
Expand Down
412 changes: 296 additions & 116 deletions packages/hms_room_kit/lib/src/preview/preview_device_settings.dart

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions packages/hms_room_kit/lib/src/preview/preview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ class _PreviewPageState extends State<PreviewPage> {
? ListenableProvider.value(
value: _meetingStore,
child: MeetingScreenController(
role: previewStore.peer?.role,
roomCode: Constant.roomCode,
localPeerNetworkQuality: null,
user: nameController.text,
),
role: previewStore.peer?.role,
roomCode: Constant.roomCode,
localPeerNetworkQuality: null,
user: nameController.text,
isRoomMute: previewStore.isRoomMute,
currentAudioDeviceMode:
previewStore.currentAudioDeviceMode),
)
: SingleChildScrollView(
///We show circular progress indicator until the local peer is null
Expand Down
6 changes: 6 additions & 0 deletions packages/hms_room_kit/lib/src/preview/preview_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,18 @@ class PreviewStore extends ChangeNotifier
}

void switchAudioOutput({required HMSAudioDevice audioDevice}) {
if (isRoomMute) {
toggleSpeaker();
}
currentAudioDeviceMode = audioDevice;
hmsSDKInteractor.switchAudioOutput(audioDevice: audioDevice);
notifyListeners();
}

void switchAudioOutputUsingiOSUI() {
if (isRoomMute) {
toggleSpeaker();
}
hmsSDKInteractor.switchAudioOutputUsingiOSUI();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class _AudioSettingsBottomSheetState extends State<AudioSettingsBottomSheet> {
return DraggableScrollableSheet(
maxChildSize:
(context.read<MeetingStore>().availableAudioOutputDevices.length +
1.4) *
2.2) *
0.1,
minChildSize:
(context.read<MeetingStore>().availableAudioOutputDevices.length +
1.2) *
2) *
0.1,
initialChildSize:
(context.read<MeetingStore>().availableAudioOutputDevices.length +
1.2) *
2) *
0.1,
builder: (context, ScrollController scrollController) {
return Container(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ class HmssdkFlutterPlugin :
HMSPipAction.disposePIP(activity)
HMSPeerListIteratorAction.clearIteratorMap()
removeAllKeyChangeListener()
setIsRoomAudioUnmutedLocally(true)
}

private fun destroy(result: Result) {
Expand Down Expand Up @@ -872,6 +873,7 @@ class HmssdkFlutterPlugin :
HMSPipAction.disposePIP(activity)
HMSPeerListIteratorAction.clearIteratorMap()
removeAllKeyChangeListener()
setIsRoomAudioUnmutedLocally(true)
}

private fun isAllowedToEndMeeting(): Boolean? {
Expand Down Expand Up @@ -1125,6 +1127,7 @@ class HmssdkFlutterPlugin :
HMSPipAction.disposePIP(activity)
HMSPeerListIteratorAction.clearIteratorMap()
removeAllKeyChangeListener()
setIsRoomAudioUnmutedLocally(true)
}
if (args["data"] != null) {
CoroutineScope(Dispatchers.Main).launch {
Expand Down
25 changes: 5 additions & 20 deletions packages/hmssdk_flutter/example/ExampleAppChangelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,10 @@ Board: https://100ms.atlassian.net/jira/software/projects/FLUT/boards/34/
Implement sending of Subscriber Stats
- https://100ms.atlassian.net/browse/FLUT-134

Upgrade Android SDK to fix Auto simulcast issue in HmsVideoView
- https://100ms.atlassian.net/browse/FLUT-145
Prebuilt: Add options to Mute Session or change Audio Output
- https://100ms.atlassian.net/browse/FLUT-155

Remove default usage of Software Echo Cancellation
- https://100ms.atlassian.net/browse/FLUT-146

Post call interruption fix
- https://100ms.atlassian.net/browse/FLUT-143

Persist Room meeting link after successfully joining the Room
- https://100ms.atlassian.net/browse/FLUT-147

Incorrect DateTime format on iOS prevents the user from Joining a Room
- https://100ms.atlassian.net/browse/FLUT-144

To handle error in case the logo url returns error
- https://100ms.atlassian.net/browse/FLUT-152

Room Kit: 1.0.3
Core SDK: 1.9.2
Room Kit: 1.0.4
Core SDK: 1.9.3
Android SDK: 2.8.0
iOS SDK: 1.2.0
iOS SDK: 1.2.1
4 changes: 2 additions & 2 deletions packages/hmssdk_flutter/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ android {
applicationId "live.hms.flutter"
minSdkVersion 21
targetSdkVersion 33
versionCode 388
versionName "1.5.88"
versionCode 389
versionName "1.5.89"
}

signingConfigs {
Expand Down
4 changes: 2 additions & 2 deletions packages/hmssdk_flutter/example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.88</string>
<string>1.5.89</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -48,7 +48,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>388</string>
<string>389</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1575,5 +1575,6 @@ public class SwiftHmssdkFlutterPlugin: NSObject, FlutterPlugin, HMSUpdateListene
removeAllKeyChangeListener()
removeHMSLogger()
HMSPeerListIteratorAction.clearIteratorMap()
setIsRoomAudioUnmutedLocally(isRoomAudioUnmuted: true)
}
}

0 comments on commit b505b85

Please sign in to comment.