From ff896768ef99f47144f7df359556dc779c36447c Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 10 Jun 2024 15:54:57 +0530 Subject: [PATCH] Added method comments --- .../lib/src/model/hms_video_filter.dart | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/hmssdk_flutter/lib/src/model/hms_video_filter.dart b/packages/hmssdk_flutter/lib/src/model/hms_video_filter.dart index 2e173b0af..0fbeaa295 100644 --- a/packages/hmssdk_flutter/lib/src/model/hms_video_filter.dart +++ b/packages/hmssdk_flutter/lib/src/model/hms_video_filter.dart @@ -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 enable({required Uint8List? image}) async { var result = await PlatformService.invokeMethod( PlatformMethod.enableVirtualBackground, @@ -19,6 +29,14 @@ 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 changeVirtualBackground( {required Uint8List? image}) async { PlatformService.invokeMethod(PlatformMethod.changeVirtualBackground, @@ -26,6 +44,9 @@ abstract class HMSVideoFilter { return null; } + ///[isSupported] returns whether virtual background is supported or not + /// + ///Refer [isSupported] Docs [here](Add link) static Future isSupported() async { var result = await PlatformService.invokeMethod( PlatformMethod.isVirtualBackgroundSupported); @@ -36,6 +57,9 @@ abstract class HMSVideoFilter { } } + ///[disable] disables virtual background + /// + ///Refer [disable] Docs [here](Add link) static Future disable() async { var result = await PlatformService.invokeMethod( PlatformMethod.disableVirtualBackground); @@ -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 enableBlur({required int blurRadius}) async { assert(blurRadius >= 0 && blurRadius <= 100, "blurRadius should be between 0 and 100, current value is $blurRadius"); @@ -60,6 +91,9 @@ abstract class HMSVideoFilter { } } + ///[disableBlur] disables blur + /// + ///Refer [disableBlur] Docs [here](Add link) static Future disableBlur() async { var result = await PlatformService.invokeMethod( PlatformMethod.disableBlurBackground);