Help Center/ Meeting/ Client SDK Reference/ Web SDK/ APIs/ Basic Settings/ Setting Whether to Allow the Microphone to Pick Up Sound When the Browser Runs in the Background
Updated on 2025-04-18 GMT+08:00

Setting Whether to Allow the Microphone to Pick Up Sound When the Browser Runs in the Background

API Description

This API is used to set whether to allow the microphone to pick up sound when the browser runs in the background.

1. This API can be called before and during a meeting.

2. By default, a PC's microphone can pick up sound when the browser runs in the background, whereas a mobile phone's microphone cannot.

Method Definition

setAllowVisibilityChange(allowVisibilityChange):void

Parameter Description

Table 1 Description

Parameter

Mandatory

Type

Description

allowVisibilityChange

Yes

boolean

true: The microphone is not allowed to pick up sound when the browser runs in the background.

false: The microphone is allowed to pick up sound when the browser runs in the background.

Return Values

For details about the error structure, see Table 3.

Sample Code

/**  
* Set whether to allow the microphone to pick up sound when the browser runs in the background.
*/  
try {
  HWMeeting.setAllowVisibilityChange(true);
} catch (e) {
  ...
}