Skip to content

Commit

Permalink
Added method comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Jun 10, 2024
1 parent 26f9826 commit ff89676
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions packages/hmssdk_flutter/lib/src/model/hms_video_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:hmssdk_flutter/src/service/platform_service.dart';

///[HMSVideoFilter] is used to apply video effects like virtual background and blur
///This is an internal library class and should not be used by the user
///To use the video filters, use the [HMSVideoPlugin] package
abstract class HMSVideoFilter {

///[enable] enables virtual background with the given image
///
///**parameters
///
///**image** - is the image to be used as virtual background
///
///Refer [enable] Docs [here](Add link)
static Future<HMSException?> enable({required Uint8List? image}) async {
var result = await PlatformService.invokeMethod(
PlatformMethod.enableVirtualBackground,
Expand All @@ -19,13 +29,24 @@ abstract class HMSVideoFilter {
}
}

///[changeVirtualBackground] changes the virtual background with the given image
///
///**parameters**
///
///**image** - is the new image to be used as virtual background
///
///Note: This method can be used only if virtual background is already enabled
///Refer [changeVirtualBackground] Docs [here](Add link)
static Future<void> changeVirtualBackground(
{required Uint8List? image}) async {
PlatformService.invokeMethod(PlatformMethod.changeVirtualBackground,
arguments: {"image": image});
return null;
}

///[isSupported] returns whether virtual background is supported or not
///
///Refer [isSupported] Docs [here](Add link)
static Future<bool> isSupported() async {
var result = await PlatformService.invokeMethod(
PlatformMethod.isVirtualBackgroundSupported);
Expand All @@ -36,6 +57,9 @@ abstract class HMSVideoFilter {
}
}

///[disable] disables virtual background
///
///Refer [disable] Docs [here](Add link)
static Future<HMSException?> disable() async {
var result = await PlatformService.invokeMethod(
PlatformMethod.disableVirtualBackground);
Expand All @@ -47,6 +71,13 @@ abstract class HMSVideoFilter {
}
}

///[enableBlur] enables blur with the given blur radius
///
///**parameters**
///
///**blurRadius** - is the radius of the blur effect
///
///Refer [enableBlur] Docs [here](Add link)
static Future<HMSException?> enableBlur({required int blurRadius}) async {
assert(blurRadius >= 0 && blurRadius <= 100,
"blurRadius should be between 0 and 100, current value is $blurRadius");
Expand All @@ -60,6 +91,9 @@ abstract class HMSVideoFilter {
}
}

///[disableBlur] disables blur
///
///Refer [disableBlur] Docs [here](Add link)
static Future<HMSException?> disableBlur() async {
var result = await PlatformService.invokeMethod(
PlatformMethod.disableBlurBackground);
Expand Down

0 comments on commit ff89676

Please sign in to comment.