Skip to content

Commit

Permalink
Updated vb functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Jun 6, 2024
1 parent 727192c commit b9c345c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/hms_room_kit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ packages:
description:
path: "."
ref: develop
resolved-ref: "4b37433ddf0144b01806d51d40a05aec0b754b00"
resolved-ref: "8db1d9dd0b560fbceba35a081fb18d2d9cb6269e"
url: "https://github.com/100mslive/hms_video_plugin.git"
source: git
version: "0.0.1"
Expand Down
9 changes: 9 additions & 0 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'dart:developer';
import 'dart:io';

//Package imports
import 'package:hms_video_plugin/hms_video_plugin.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -1351,6 +1352,14 @@ class MeetingStore extends ChangeNotifier
// clearPIPState();
removeListeners();
toggleAlwaysScreenOn();
if (AppDebugConfig.isBlurEnabled) {
HMSVideoPlugin.disableBlur();
AppDebugConfig.isBlurEnabled = false;
}
if (AppDebugConfig.isVBEnabled) {
HMSVideoPlugin.disable();
AppDebugConfig.isVBEnabled = false;
}
_hmsSDKInteractor.destroy();
_hmsSessionStore = null;
peerTracks.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ library;
///Package imports
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';
import 'package:hms_video_plugin/hms_video_plugin.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:image_picker/image_picker.dart';

///Project imports
import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/hms_cross_button.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/hms_subheading_text.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/more_option_item.dart';
import 'package:provider/provider.dart';

///[VideoEffectsBottomSheet] is a bottom sheet that is used to change the video effects
class VideoEffectsBottomSheet extends StatefulWidget {
final HMSVideoTrack? localVideoTrack;

const VideoEffectsBottomSheet({super.key, this.localVideoTrack});
@override
State<VideoEffectsBottomSheet> createState() =>
_VideoEffectsBottomSheetState();
Expand All @@ -31,6 +37,13 @@ class _VideoEffectsBottomSheetState extends State<VideoEffectsBottomSheet> {
} else if (AppDebugConfig.isVBEnabled) {
setEffect("background");
}
context.read<MeetingStore>().addBottomSheet(context);
}

@override
void deactivate() {
context.read<MeetingStore>().removeBottomSheet(context);
super.deactivate();
}

void changeBlur(int blurRadius) {
Expand Down Expand Up @@ -114,7 +127,7 @@ class _VideoEffectsBottomSheetState extends State<VideoEffectsBottomSheet> {
if (AppDebugConfig.isBlurEnabled) {
HMSVideoPlugin.disableBlur();
AppDebugConfig.isBlurEnabled = false;
} else if (AppDebugConfig.isVirtualBackgroundEnabled) {
} else if (AppDebugConfig.isVBEnabled) {
HMSVideoPlugin.disable();
AppDebugConfig.isVBEnabled = false;
}
Expand All @@ -138,6 +151,7 @@ class _VideoEffectsBottomSheetState extends State<VideoEffectsBottomSheet> {
child: MoreOptionItem(
onTap: () {
Navigator.pop(context);
AppDebugConfig.isVBEnabled = false;
changeBlur(100);
},
optionIcon: SvgPicture.asset(
Expand All @@ -157,6 +171,7 @@ class _VideoEffectsBottomSheetState extends State<VideoEffectsBottomSheet> {
Expanded(
child: MoreOptionItem(
onTap: () async {
AppDebugConfig.isBlurEnabled = false;
Navigator.pop(context);
setEffect("background");
XFile? result = await ImagePicker()
Expand Down
2 changes: 1 addition & 1 deletion packages/hms_room_kit/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ packages:
description:
path: "."
ref: develop
resolved-ref: "4b37433ddf0144b01806d51d40a05aec0b754b00"
resolved-ref: "8db1d9dd0b560fbceba35a081fb18d2d9cb6269e"
url: "https://github.com/100mslive/hms_video_plugin.git"
source: git
version: "0.0.1"
Expand Down
3 changes: 3 additions & 0 deletions packages/hmssdk_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ class _HomePageState extends State<HomePage> {
borderRadius: BorderRadius.circular(8.0),
))),
onPressed: () async {
bool isVBEnabled = await Utilities.getBoolData(
key: "is_virtual_background_enabled")??false;
AppDebugConfig.isVirtualBackgroundEnabled = isVBEnabled;
joinMeeting();
},
child: Container(
Expand Down
2 changes: 1 addition & 1 deletion packages/hmssdk_flutter/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ packages:
description:
path: "."
ref: develop
resolved-ref: "3ea3e5d0b31fc8ab2653f169f957fafd4766a6c0"
resolved-ref: "8db1d9dd0b560fbceba35a081fb18d2d9cb6269e"
url: "https://github.com/100mslive/hms_video_plugin.git"
source: git
version: "0.0.1"
Expand Down

0 comments on commit b9c345c

Please sign in to comment.