Skip to content

Commit

Permalink
Merge pull request #1697 from 100mslive/develop
Browse files Browse the repository at this point in the history
Release 1.9.7: Develop to main
  • Loading branch information
Decoder07 authored Jan 18, 2024
2 parents 9714996 + 6a19279 commit c221391
Show file tree
Hide file tree
Showing 25 changed files with 257 additions and 245 deletions.
13 changes: 13 additions & 0 deletions packages/hms_room_kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
| 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.10 - 2024-01-18

| Package | Version |
| -------------- | ------------------------------------------------------------------------------------------------------ |
| hms_room_kit | 1.0.10 |
| hmssdk_flutter | 1.9.7 |

### 🚀 Added

- Auto-Hide Top & Bottom Bars after 5 seconds

Top & Bottom Bars will be hidden after 5 seconds of inactivity.

## 1.0.9 - 2024-01-15

| 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.9"
version: "1.0.10"
hmssdk_flutter:
dependency: transitive
description:
name: hmssdk_flutter
sha256: "112381755d47a639ef296295ace5b9d73267b89458f33ac767d1b6536a3fc898"
sha256: "78db3329609ca9f9a90168d45b9bed0ff56f43d1eeb13b532aa376de2aa44a4a"
url: "https://pub.dev"
source: hosted
version: "1.9.6"
version: "1.9.7"
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.9
version: 1.0.10

environment:
sdk: ">=2.19.6 <3.0.0"
Expand Down
10 changes: 1 addition & 9 deletions packages/hms_room_kit/lib/src/common/utility_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ class Utilities {
await Permission.microphone.request();
if (Platform.isIOS) {
await Permission.bluetooth.request();
} else if (Platform.isAndroid) {
await Permission.bluetoothConnect.request();
}

await Permission.phone.request();

///We check if the permissions are granted
Expand All @@ -158,8 +155,7 @@ class Utilities {
} else if (Platform.isAndroid) {
if (await Permission.camera.isGranted &&
await Permission.microphone.isGranted &&
await Permission.phone.isGranted &&
await Permission.bluetoothConnect.isGranted) {
await Permission.phone.isGranted) {
return true;
}
}
Expand All @@ -179,10 +175,6 @@ class Utilities {
if (Platform.isIOS) {
isBluetoothPermissionsDenied =
await Permission.bluetooth.isPermanentlyDenied;
} else if (Platform.isAndroid) {
isBluetoothPermissionsDenied =
(await Permission.bluetoothConnect.isDenied &&
!await Permission.bluetoothConnect.shouldShowRequestRationale);
}

///We open the app settings if the user has permanently denied the permissions
Expand Down
124 changes: 124 additions & 0 deletions packages/hms_room_kit/lib/src/meeting/meeting_grid_component.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
///Dart imports
import 'dart:io';

///Package imports
import 'package:flutter/material.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';

///Project imports
import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:hms_room_kit/src/enums/meeting_mode.dart';
import 'package:hms_room_kit/src/meeting/meeting_navigation_visibility_controller.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';
import 'package:hms_room_kit/src/model/peer_track_node.dart';
import 'package:hms_room_kit/src/widgets/meeting_modes/custom_one_to_one_grid.dart';
import 'package:hms_room_kit/src/widgets/meeting_modes/one_to_one_mode.dart';

///[MeetingGridComponent] is a component that is used to show the video grid
class MeetingGridComponent extends StatelessWidget {
final MeetingNavigationVisibilityController? visibilityController;

const MeetingGridComponent({super.key, required this.visibilityController});

@override
Widget build(BuildContext context) {
return Selector<
MeetingStore,
Tuple6<List<PeerTrackNode>, bool, int, int, MeetingMode,
PeerTrackNode?>>(
selector: (_, meetingStore) => Tuple6(
meetingStore.peerTracks,
meetingStore.isHLSLink,
meetingStore.peerTracks.length,
meetingStore.screenShareCount,
meetingStore.meetingMode,
meetingStore.peerTracks.isNotEmpty
? meetingStore.peerTracks[meetingStore.screenShareCount]
: null),
builder: (_, data, __) {
if (data.item3 == 0) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator(
strokeWidth: 2,
color: HMSThemeColors.primaryDefault,
),
const SizedBox(
height: 10,
),
if (context.read<MeetingStore>().peers.isNotEmpty)
HMSTitleText(
text: "Please wait for broadcaster to join",
textColor: HMSThemeColors.onSurfaceHighEmphasis)
],
));
}
return Selector<MeetingStore, Tuple2<MeetingMode, HMSPeer?>>(
selector: (_, meetingStore) =>
Tuple2(meetingStore.meetingMode, meetingStore.localPeer),
builder: (_, modeData, __) {
///This renders the video grid based on whether the controls are visible or not
return Selector<MeetingNavigationVisibilityController, bool>(
selector: (_, meetingNavigationVisibilityController) =>
meetingNavigationVisibilityController.showControls,
builder: (_, showControls, __) {
return Center(
child: AnimatedContainer(
duration: const Duration(milliseconds: 200),

///If the controls are visible we reduce the
///height of video grid by 140 else it covers the whole screen
///
///Here we also check for the platform and reduce the height accordingly
height: showControls
? MediaQuery.of(context).size.height -
MediaQuery.of(context).padding.top -
MediaQuery.of(context).padding.bottom -
(Platform.isAndroid
? 160
: Platform.isIOS
? 230
: 160)
: MediaQuery.of(context).size.height -
MediaQuery.of(context).padding.top -
MediaQuery.of(context).padding.bottom -
20,
child: GestureDetector(
onTap: () => visibilityController
?.toggleControlsVisibility(),
child: (modeData.item1 ==
MeetingMode.activeSpeakerWithInset &&
(context
.read<MeetingStore>()
.localPeer
?.audioTrack !=
null ||
context
.read<MeetingStore>()
.localPeer
?.videoTrack !=
null))
? OneToOneMode(
///This is done to keep the inset tile
///at correct position when controls are hidden
bottomMargin: showControls ? 250 : 130,
peerTracks: data.item1,
screenShareCount: data.item4,
context: context,
)
: CustomOneToOneGrid(
isLocalInsetPresent: false,
peerTracks: data.item1,
),
),
),
);
});
});
});
}
}
2 changes: 1 addition & 1 deletion packages/hms_room_kit/lib/src/meeting/meeting_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class _MeetingHeaderState extends State<MeetingHeader> {
///else we render an empty SizedBox
Selector<MeetingStore, Tuple2<HMSAudioDevice?, bool>>(
selector: (_, meetingStore) => Tuple2(
meetingStore.currentAudioDeviceMode,
meetingStore.currentAudioOutputDevice,
meetingStore.isSpeakerOn),
builder: (_, data, __) {
return HMSEmbeddedButton(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
///Dart imports
import 'dart:async';

///Package imports
import 'package:flutter/widgets.dart';

class MeetingNavigationVisibilityController extends ChangeNotifier {
bool showControls = true;

///This variable stores whether the timer is active or not
///
///This is done to avoid multiple timers running at the same time
bool _isTimerActive = false;

///This method toggles the visibility of the buttons
void toggleControlsVisibility() {
showControls = !showControls;

///If the controls are now visible and
///If the timer is not active, we start the timer
if (showControls && !_isTimerActive) {
startTimerToHideButtons();
}
notifyListeners();
}

///This method starts a timer for 5 seconds and then hides the buttons
void startTimerToHideButtons() {
_isTimerActive = true;
Timer(const Duration(seconds: 5), () {
showControls = false;
_isTimerActive = false;
notifyListeners();
});
}
}
Loading

0 comments on commit c221391

Please sign in to comment.