Agora Java API Reference for Android
io.agora.rtc.video.VirtualBackgroundSource Class Reference

Public Member Functions

 VirtualBackgroundSource (int backgroundSourceType, int color, String source, int blur_degree)
 

Public Attributes

int backgroundSourceType
 
int color
 
String source = null
 
int blur_degree
 

Static Public Attributes

static final int BACKGROUND_COLOR = 1
 
static final int BACKGROUND_IMG = 2
 
static final int BACKGROUND_BLUR = 3
 
static final int BLUR_DEGREE_LOW = 1
 
static final int BLUR_DEGREE_MEDIUM = 2
 
static final int BLUR_DEGREE_HIGH = 3
 

Detailed Description

The custom background image.

Since
v3.5.0

Member Data Documentation

◆ BACKGROUND_COLOR

final int io.agora.rtc.video.VirtualBackgroundSource.BACKGROUND_COLOR = 1
static

1: (Default) The background image is a solid color.

◆ BACKGROUND_IMG

final int io.agora.rtc.video.VirtualBackgroundSource.BACKGROUND_IMG = 2
static

2: The background image is a file in PNG or JPG format.

◆ BACKGROUND_BLUR

final int io.agora.rtc.video.VirtualBackgroundSource.BACKGROUND_BLUR = 3
static

3: The background image is blurred.

Since
v3.5.1

◆ BLUR_DEGREE_LOW

final int io.agora.rtc.video.VirtualBackgroundSource.BLUR_DEGREE_LOW = 1
static

1: The degree of blurring applied to the custom background image is low. The user can almost see the background clearly.

Since
v3.5.1

◆ BLUR_DEGREE_MEDIUM

final int io.agora.rtc.video.VirtualBackgroundSource.BLUR_DEGREE_MEDIUM = 2
static

2: The degree of blurring applied to the custom background image is medium. It is difficult for the user to recognize details in the background.

Since
v3.5.1

◆ BLUR_DEGREE_HIGH

final int io.agora.rtc.video.VirtualBackgroundSource.BLUR_DEGREE_HIGH = 3
static

3: (Default) The degree of blurring applied to the custom background image is high. The user can barely see any distinguishing features in the background.

Since
v3.5.1

◆ backgroundSourceType

int io.agora.rtc.video.VirtualBackgroundSource.backgroundSourceType

The type of the custom background image:

◆ color

int io.agora.rtc.video.VirtualBackgroundSource.color

The color of the custom background image. The format is a hexadecimal integer defined by RGB, without the # sign, such as 0xFFB6C1 for light pink. The default value is 0xFFFFFF, which signifies white. The value range is [0x000000,0xffffff]. If the value is invalid, the SDK replaces the original background image with a white background image.

Note
This parameter takes effect only when the type of the custom background image is BACKGROUND_COLOR.

◆ source

String io.agora.rtc.video.VirtualBackgroundSource.source = null

The local absolute path of the custom background image. PNG and JPG formats are supported. If the path is invalid, the SDK replaces the original background image with a white background image.

Note
This parameter takes effect only when the type of the custom background image is BACKGROUND_IMG.

◆ blur_degree

int io.agora.rtc.video.VirtualBackgroundSource.blur_degree

The degree of blurring applied to the custom background image:

  • BLUR_DEGREE_LOW(1): The degree of blurring applied to the custom background image is low. The user can almost see the background clearly.
  • BLUR_DEGREE_MEDIUM(2): The degree of blurring applied to the custom background image is medium. It is difficult for the user to recognize details in the background.
  • BLUR_DEGREE_HIGH(3): (Default) The degree of blurring applied to the custom background image is high. The user can barely see any distinguishing features in the background.
Note
This parameter takes effect only when the type of the custom background image is BACKGROUND_BLUR.
Since
v3.5.1