VirtualBackgroundSource
- HarmonyOS
更新时间
自定义的背景。
export class VirtualBackgroundSource {
public static readonly BACKGROUND_NONE:number = 0;
public static readonly BACKGROUND_COLOR:number = 1;
public static readonly BACKGROUND_IMG:number = 2;
public static readonly BACKGROUND_BLUR:number = 3;
public static readonly BACKGROUND_VIDEO:number = 4;
public static readonly BLUR_DEGREE_LOW:number = 1;
public static readonly BLUR_DEGREE_MEDIUM:number = 2;
public static readonly BLUR_DEGREE_HIGH:number = 3;
public backgroundSourceType:number = VirtualBackgroundSource.BACKGROUND_COLOR;
public color:number = 0xffffff;
public source?:string;
public blurDegree:number = VirtualBackgroundSource.BLUR_DEGREE_HIGH;
}| 参数名 | 描述 |
|---|---|
backgroundSourceType | 自定义的背景。
|
color | 自定义的背景图颜色。格式为 RGB 定义下的十六进制整数,不带 # 号,如 0xFFB6C1 表示浅粉色。 默认值为 0xFFFFFF,表示白色。 取值范围为 [0x000000,0xffffff]。如果取值非法,SDK 会用白色背景图替换原背景图。 注意: 该参数仅在自定义背景为以下类型时生效,具体效果如下:
|
source | 自定义背景的本地绝对路径。支持 PNG、JPG、MP4、 AVI、 MKV 和 FLV 格式。如果路径无效,SDK 会使用原背景图或 color 指定的纯色背景。 注意: 该参数仅在自定义背景图类型为 IMG 或 VIDEO 时生效。 |
blurDegree | 自定义背景图的模糊程度。
注意: 该参数仅在自定义背景图类型为 BLUR 时生效。 |