lynx: setObserverFrameRate() static method

The lynx.setObserverFrameRate method can be used to set the frequency of exposure detection.

grammar

setObserverFrameRate(options?: Options): void;

Parameters

options

interface Options {
  forPageRect?: number;
  forExposureCheck?: number;
}

Specify exposure detection frequency:

  • forPageRect: unit fps, specifies the minimum time interval for detecting LynxView position changes. Defaults to 20.
  • forExposureCheck: unit fps, specifies the minimum time interval for detecting the visibility of the target node. Defaults to 20.

return value

None (undefined).

Precautions

When LynxView will not have position changes, such as full-page scenarios, you can set forPageRect to 0 to stop detecting position changes of LynxView. However, in the card scene, setting forPageRect to 0 will cause the exposure of the Lynx card to fail in the sliding scene. For details, please refer to Exposure Ability.

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.