Skip to content

Commit

Permalink
Merge branch 'develop' into release-1.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 authored Jun 7, 2024
2 parents 19dd5eb + 0054006 commit fc10923
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 279 deletions.
12 changes: 11 additions & 1 deletion packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ class MeetingStore extends ChangeNotifier

int currentScreenSharePage = 0;

///This stores whether whiteboard or screenshare is in full screen mode
bool isScreenshareWhiteboardFullScreen = false;

///PeerList iterators
///This is a map with key as role and value as the iterator for that role
Map<String, HMSPeerListIterator> peerListIterators = {};
Expand Down Expand Up @@ -1761,10 +1764,17 @@ class MeetingStore extends ChangeNotifier
int peerIndex = peerTracks.indexWhere(
(element) => element.uid == peer.peerId + track.trackId);
if (peerIndex != -1) {
if ((screenShareCount - 1) == currentScreenSharePage) {
///This is done to handle the case when the screen share is stopped
///and the user is on the last page of the screen share
///we need to move the user to the previous page
if (((screenShareCount - 1) == currentScreenSharePage) &&
currentScreenSharePage > 0) {
currentScreenSharePage--;
}
screenShareCount--;
if (screenShareCount == 0) {
isScreenshareWhiteboardFullScreen = false;
}
peerTracks.removeAt(peerIndex);
notifyListeners();
// changePIPWindowTextOnIOS(text: localPeer?.name, ratio: [9, 16]);
Expand Down
262 changes: 9 additions & 253 deletions packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class _ScreenshareGridLayoutState extends State<ScreenshareGridLayout> {
if (widget.screenshareCount > 0)
Expanded(
child: PageView.builder(
physics: const PageScrollPhysics(),
physics: isFullScreen
? const NeverScrollableScrollPhysics()
: const PageScrollPhysics(),
allowImplicitScrolling: true,
itemCount: widget.screenshareCount,
onPageChanged: (newPage) {
Expand All @@ -92,7 +94,7 @@ class _ScreenshareGridLayoutState extends State<ScreenshareGridLayout> {
///The number of dots is equal to [number of screens being shared]
///The active dot is the current page
///The inactive dots are the pages other than the current page
if (widget.screenshareCount > 1)
if (!isFullScreen && widget.screenshareCount > 1)
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Selector<MeetingStore, int>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class _CustomOneToOneGridState extends State<CustomOneToOneGrid> {
int pageCount =
(numberOfPeers ~/ 6) + (numberOfPeers % 6 == 0 ? 0 : 1);

var screenshareStore = WhiteboardScreenshareStore();
var screenshareStore = WhiteboardScreenshareStore(
meetingStore: context.read<MeetingStore>());

///If the remote peer is sharing screen then we render the [ScreenshareGridLayout] with inset tile
///Else we render the normal layout with inset tile
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
library;

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

///Project imports
import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:hms_room_kit/src/model/peer_track_node.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/video_view.dart';
import 'package:hms_room_kit/src/widgets/peer_widgets/rtc_stats_view.dart';
import 'package:hms_room_kit/src/widgets/peer_widgets/screen_share_tile_name.dart';
import 'package:hms_room_kit/src/widgets/whiteboard_screenshare/whiteboard_screenshare_store.dart';

///[ScreenshareTile] is a widget that is used to render the screenshare tile
///It is used to render the screenshare of the peer
class ScreenshareTile extends StatelessWidget {
const ScreenshareTile({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Stack(
children: [
VideoView(
uid: context.read<PeerTrackNode>().uid,
scaleType: ScaleType.SCALE_ASPECT_FIT,
),
Positioned(
top: 5,
right: 5,
child: GestureDetector(
onTap: () {
context.read<WhiteboardScreenshareStore>().toggleFullScreen();
},
child: Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: HMSThemeColors.backgroundDim.withAlpha(64),
borderRadius: BorderRadius.circular(8)),
child: Center(
child: Selector<WhiteboardScreenshareStore, bool>(
selector: (_, whiteboardScreenshareStore) =>
whiteboardScreenshareStore.isFullScreen,
builder: (_, isFullScreen, __) {
return SvgPicture.asset(
"packages/hms_room_kit/lib/src/assets/icons/${isFullScreen ? "minimize" : "maximize"}.svg",
height: 16,
width: 16,
semanticsLabel: "maximize_label",
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
);
}),
),
),
)),
Positioned(
//Bottom left
bottom: 5,
left: 5,
child: Container(
decoration: BoxDecoration(
color: HMSThemeColors.backgroundDim.withOpacity(0.64),
borderRadius: BorderRadius.circular(8)),
child: Center(
child: Padding(
padding: const EdgeInsets.only(
left: 8.0, right: 4, top: 4, bottom: 4),
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
"packages/hms_room_kit/lib/src/assets/icons/screen_share.svg",
height: 20,
width: 20,
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
),
const SizedBox(
width: 6,
),
LayoutBuilder(
builder: (context, BoxConstraints constraints) {
return ScreenshareTileName(
maxWidth: constraints.maxWidth);
})
],
),
),
),
),
),
const RTCStatsView(isLocal: false),
],
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ library;

///Package imports
import 'package:flutter/material.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';

///[WhiteboardScreenshareStore] is a store that stores the state of the whiteboard screenshare
class WhiteboardScreenshareStore extends ChangeNotifier {
MeetingStore meetingStore;
bool isFullScreen = false;

WhiteboardScreenshareStore({required this.meetingStore}) {
isFullScreen = meetingStore.isScreenshareWhiteboardFullScreen;
}

void toggleFullScreen() {
isFullScreen = !isFullScreen;
meetingStore.isScreenshareWhiteboardFullScreen = isFullScreen;
notifyListeners();
}
}
40 changes: 20 additions & 20 deletions packages/hmssdk_flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ PODS:
- Firebase/Performance (= 10.18.0)
- firebase_core
- Flutter
- FirebaseABTesting (10.25.0):
- FirebaseABTesting (10.27.0):
- FirebaseCore (~> 10.0)
- FirebaseCore (10.18.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreExtension (10.25.0):
- FirebaseCoreExtension (10.27.0):
- FirebaseCore (~> 10.0)
- FirebaseCoreInternal (10.25.0):
- FirebaseCoreInternal (10.27.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseCrashlytics (10.18.0):
- FirebaseCore (~> 10.5)
Expand All @@ -47,7 +47,7 @@ PODS:
- PromisesObjC (~> 2.1)
- FirebaseDynamicLinks (10.18.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (10.25.0):
- FirebaseInstallations (10.27.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
Expand All @@ -62,16 +62,16 @@ PODS:
- GoogleUtilities/ISASwizzler (~> 7.8)
- GoogleUtilities/MethodSwizzler (~> 7.8)
- nanopb (< 2.30910.0, >= 2.30908.0)
- FirebaseRemoteConfig (10.25.0):
- FirebaseRemoteConfig (10.27.0):
- FirebaseABTesting (~> 10.0)
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- FirebaseRemoteConfigInterop (~> 10.23)
- FirebaseSharedSwift (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseRemoteConfigInterop (10.25.0)
- FirebaseSessions (10.25.0):
- FirebaseRemoteConfigInterop (10.27.0)
- FirebaseSessions (10.27.0):
- FirebaseCore (~> 10.5)
- FirebaseCoreExtension (~> 10.0)
- FirebaseInstallations (~> 10.0)
Expand All @@ -80,7 +80,7 @@ PODS:
- GoogleUtilities/UserDefaults (~> 7.13)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesSwift (~> 2.1)
- FirebaseSharedSwift (10.25.0)
- FirebaseSharedSwift (10.27.0)
- Flutter (1.0.0)
- flutter_foreground_task (0.0.1):
- Flutter
Expand Down Expand Up @@ -132,15 +132,15 @@ PODS:
- HMSHLSPlayerSDK (0.0.2):
- HMSAnalyticsSDK (= 0.0.2)
- HMSNoiseCancellationModels (1.0.0)
- HMSSDK (1.11.0):
- HMSSDK (1.12.0):
- HMSAnalyticsSDK (= 0.0.2)
- HMSWebRTC (= 1.0.6169)
- hmssdk_flutter (1.10.2):
- Flutter
- HMSBroadcastExtensionSDK (= 0.0.9)
- HMSHLSPlayerSDK (= 0.0.2)
- HMSNoiseCancellationModels (= 1.0.0)
- HMSSDK (= 1.11.0)
- HMSSDK (= 1.12.0)
- HMSWebRTC (1.0.6169)
- image_picker_ios (0.0.1):
- Flutter
Expand Down Expand Up @@ -296,18 +296,18 @@ SPEC CHECKSUMS:
firebase_crashlytics: 4b91b8ad60ee7c168fe88979f84c9573a729de7a
firebase_dynamic_links: b626a11f5eb02033981ae377377c3f297eb4c1b0
firebase_performance: 2183122a3c7a650c80d8c164e9e28f13c4c62fc7
FirebaseABTesting: e6e3c3e0e35813874f571d1b7bdae2aab319dd38
FirebaseABTesting: 038a7d5f1e36ba7208cf34f6f596946d8f70d6c3
FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
FirebaseCoreExtension: 8a47811d0b155501559ef05d089518152a0a1677
FirebaseCoreInternal: 910a81992c33715fec9263ca7381d59ab3a750b7
FirebaseCoreExtension: 4ec89dd0c6de93d6becde32122d68b7c35f6bf5d
FirebaseCoreInternal: 4b297a2d56063dbea2c1d0d04222d44a8d058862
FirebaseCrashlytics: 86d5bce01f42fa1db265f87ff1d591f04db610ec
FirebaseDynamicLinks: c37307441c53838d66a9650dabca9e0459502527
FirebaseInstallations: 91950fe859846fff0fbd296180909dd273103b09
FirebaseInstallations: 766dabca09fd94aef922538aaf144cc4a6fb6869
FirebasePerformance: c406a9198d8aabfbac281b42855f5122fc1bcf69
FirebaseRemoteConfig: 9f3935cefecd85d5b312192117f444957de24a75
FirebaseRemoteConfigInterop: b25018791b204c0d78a90e394d6c62d9b1f22da8
FirebaseSessions: c0939656253a1fa0e94ecc266ccf770cc8b33732
FirebaseSharedSwift: 0274086954b1b2d5fd7e829eccc587044d72a4ba
FirebaseRemoteConfig: 37a2ba3c8c454be8553a41ba1a2f4a4f0b845670
FirebaseRemoteConfigInterop: c55a739f5ab121792776e191d9fd437dc624a541
FirebaseSessions: 2fdf949f9e58295a57703ae8f2efc44f9fa3aa16
FirebaseSharedSwift: a03fe7a59ee646fef71099a887f774fe25d745b8
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
Expand All @@ -321,8 +321,8 @@ SPEC CHECKSUMS:
HMSBroadcastExtensionSDK: d80fe325f6c928bd8e5176290b5a4b7ae15d6fbb
HMSHLSPlayerSDK: 6a54ad4d12f3dc2270d1ecd24019d71282a4f6a3
HMSNoiseCancellationModels: a3bda1405a16015632f4bcabd46ce48f35103b02
HMSSDK: cdba5b12c080832d135af7bbc4ca6282b0e171ac
hmssdk_flutter: 3813b9229fdd6437041d970a449a64575fb1cbd1
HMSSDK: 137107663eedc276c22639b2ec941c1f14f75d23
hmssdk_flutter: c0c621052818420aa182a69576ba9d1c576f06f3
HMSWebRTC: 8f51ba33a0e505e17ebf3d7b37bcdca266751a13
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
MLImage: 7bb7c4264164ade9bf64f679b40fb29c8f33ee9b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HMSPermissionExtension {
]
}

static func getMapFromHMSWhiteboardPermission(hmsWhiteboardPermission: HMSWhiteboardPermission?) -> [String: Any?]? {
static func getMapFromHMSWhiteboardPermission(hmsWhiteboardPermission: HMSWhiteboardPermissions?) -> [String: Any?]? {

guard let hmsWhiteboardPermission = hmsWhiteboardPermission
else {
Expand Down
2 changes: 1 addition & 1 deletion packages/hmssdk_flutter/lib/assets/sdk-versions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"flutter": "1.10.2",
"ios": "1.11.0",
"ios": "1.12.0",
"iOSBroadcastExtension": "0.0.9",
"iOSHLSPlayerSDK": "0.0.2",
"iOSNoiseCancellationModels": "1.0.0",
Expand Down

0 comments on commit fc10923

Please sign in to comment.