This API is used via wx.setVisualEffectOnCapture(Object object).
Attribute | Type | Default value | Required | Description |
visualEffect | string | none | No | The display performance during screenshot/screen recording only supports 'none' or 'hidden'. If 'hidden' is passed in, it indicates that the screen will be hidden during screenshot/screen recording. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
This API is used via wx.setScreenBrightness(Object object).
Attribute | Type | Default value | Required | Description |
value | number | - | Yes | Screen brightness value, ranging from 0 to 1, where 0 is the darkest and 1 is the brightest. On the Android platform, a special value of -1 is supported, indicating that the screen brightness will adjust according to system changes. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
This API is used via wx.setKeepScreenOn(Object object).
Attribute | Type | Default value | Required | Description |
keepScreenOn | boolean | - | Yes | Whether to maintain constant screen brightness |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.setKeepScreenOn({keepScreenOn: true})
This API is used via wx.onUserCaptureScreen(function listener).
wx.onUserCaptureScreen(function (res) {console.log('User has taken a screenshot')})
This API is used via wx.onScreenRecordingStateChanged(function listener).
Attribute | Type | Description |
state | string | Screen recording status, whose valid values include: start: Start screen recording stop: Stop screen recording |
// Monitor user-initiated screen recording events.const handler = function (res) {console.log(res.state)}wx.onScreenRecordingStateChanged(handler)// Cancel the monitoring of user-initiated screen recording events.wx.offScreenRecordingStateChanged(handler)
This API is used via wx.offUserCaptureScreen(function callback).
This API is used via wx.offScreenRecordingStateChanged(function listener).
// Monitor user-initiated screen recording events.const handler = function (res) {console.log(res.state)}wx.onScreenRecordingStateChanged(handler)// Cancel the monitoring of user-initiated screen recording events.wx.offScreenRecordingStateChanged(handler)
const listener = function (res) { console.log(res) }wx.onScreenRecordingStateChanged(listener)wx.offScreenRecordingStateChanged(listener) // The same function object as the listener must be passed in.
This API is used via wx.getScreenRecordingState(Object object).
Attribute | Type | Default value | Required | Description |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Attribute | Type | Description |
state | string | Screen recording status, whose valid values include: on: Enable off: Disable |
wx.getScreenRecordingState({success: function (res) {console.log(res.state)},})
This API is used via wx.getScreenBrightness(Object object).
Attribute | Type | Default value | Required | Description |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Attribute | Type | Description |
value | number | Screen brightness value, ranging from 0 to 1, where 0 is the darkest and 1 is the brightest. |
Was this page helpful?