This API is called using wx.setVisualEffectOnCapture(Object object).
Property | Type | Default value | Required | Description |
visualEffect | string | none | False | The visual effect during screenshot/recording. Supports none or hidden. Passing hidden will hide the screen during capture. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
This API is called using wx.setScreenBrightness(Object object).
Property | Type | Default value | Required | Description |
value | number | - | True | Screen brightness value, ranging from 0 (darkest) to 1 (brightest). On Android, supports a special value of -1, which means the screen brightness follows the system setting. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
This API is called using wx.setKeepScreenOn(Object object).
Property | Type | Default value | Required | Description |
keepScreenOn | boolean | - | True | Whether to keep the screen on. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
wx.setKeepScreenOn({keepScreenOn: true})
This API is called using wx.onUserCaptureScreen(function listener).
wx.onUserCaptureScreen(function (res) {console.log('User took a screenshot')})
This API is called using wx.onScreenRecordingStateChanged(function listener).
Property | Type | Description |
state | string | Screen recording status. Valid values: start: Screen recording started stop: Screen recording stopped |
// Listen for user-initiated screen recording eventconst handler = function (res) {console.log(res.state)}wx.onScreenRecordingStateChanged(handler)// Cancel listening for user screen recording eventwx.offScreenRecordingStateChanged(handler)
This API is called using wx.offUserCaptureScreen(function callback).
This API is called using wx.offScreenRecordingStateChanged(function listener).
// Listen for user-initiated screen recording eventconst handler = function (res) {console.log(res.state)}wx.onScreenRecordingStateChanged(handler)// Cancel listening for user screen recording eventwx.offScreenRecordingStateChanged(handler)
const listener = function (res) { console.log(res) }wx.onScreenRecordingStateChanged(listener)wx.offScreenRecordingStateChanged(listener) // Must pass the same function object used in onScreenRecordingStateChanged
This API is called using wx.getScreenRecordingState(Object object).
Property | Type | Default value | Required | Description |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
Property | Type | Description |
state | string | Screen recording status. Valid values: on: Enabled off: Disabled |
wx.getScreenRecordingState({success: function (res) {console.log(res.state)},})
This API is called using wx.getScreenBrightness(Object object).
Property | Type | Default value | Required | Description |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
Property | Type | Description |
value | number | Screen brightness value, ranging from 0 (darkest) to 1 (brightest). |