tencent cloud

Feedback

Last updated: 2024-11-21 18:48:11

    setVisualEffectOnCapture

    This API is used via wx.setVisualEffectOnCapture(Object object).
    Feature Description: Sets the screen display performance during screenshot/screen recording, which is only supported for calls on the Android platform.
    Parameter and Description: 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)

    setScreenBrightness

    This API is used via wx.setScreenBrightness(Object object).
    Feature Description: Adjusts the screen brightness.
    Parameter and Description: 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)

    setKeepScreenOn

    This API is used via wx.setKeepScreenOn(Object object).
    Feature Description: Sets whether to maintain a constant brightness. This setting is only effective within the current mini program and will be invalidated upon exiting.
    Parameter and Description: 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)
    Sample Code
    wx.setKeepScreenOn({
    keepScreenOn: true
    })

    onUserCaptureScreen

    This API is used via wx.onUserCaptureScreen(function listener).
    Feature Description: Monitors user-initiated screenshot events. This is triggered when the user uses the system screenshot key, and only one listener can be registered.
    Parameter and Description: function listener, the monitoring function for user-initiated screenshot events.
    Sample Code
    wx.onUserCaptureScreen(function (res) {
    console.log('User has taken a screenshot')
    })

    onScreenRecordingStateChanged

    This API is used via wx.onScreenRecordingStateChanged(function listener).
    Feature Description: Monitors user-initiated screen recording events.
    Parameter and Description: function listener, the monitoring function for user-initiated screen recording events.
    Attribute
    Type
    Description
    state
    string
    Screen recording status, whose valid values include:
    start: Start screen recording
    stop: Stop screen recording
    Sample Code
    // 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)

    offUserCaptureScreen

    This API is used via wx.offUserCaptureScreen(function callback).
    Feature Description: Cancels monitoring of user-initiated screenshot events.
    Parameter and Description: function callback, the callback function of "user-initiated screenshot events".

    offScreenRecordingStateChanged

    This API is used via wx.offScreenRecordingStateChanged(function listener).
    Feature Description: Removes the listener function for user-initiated screenshot events.
    Parameter and Description: function listener, the listener function passed in by onScreenRecordingStateChanged. If this parameter is not passed in, all listener functions will be removed.
    Sample Code
    // 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.

    getScreenRecordingState

    This API is used via wx.getScreenRecordingState(Object object).
    Feature Description: Inquires the user is currently recording the screen.
    Parameter and Description: 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)
    Parameters for object.success callback function: Object res.
    Attribute
    Type
    Description
    state
    string
    Screen recording status, whose valid values include:
    on: Enable
    off: Disable
    Sample Code
    wx.getScreenRecordingState({
    success: function (res) {
    console.log(res.state)
    },
    })

    getScreenBrightness

    This API is used via wx.getScreenBrightness(Object object).
    Note:
    If the automatic brightness adjustment feature is enabled in the Android system settings, the screen brightness will adjust automatically according to the light. This interface can only get the value prior to the automatic brightness adjustment, not the real-time brightness value.
    Feature Description: Gets screen brightness.
    Parameter and Description: 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)
    Parameters for object.success callback function: Object.
    Attribute
    Type
    Description
    value
    number
    Screen brightness value, ranging from 0 to 1, where 0 is the darkest and 1 is the brightest.
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support