lynx: setObserverFrameRate() static method

lynx.setObserverFrameRate 方法可以被用来设置曝光检测的频率。

语法

setObserverFrameRate(options?: Options): void;

参数

options

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

指定曝光检测频率:

  • forPageRec:单位 fps,指定检测 LynxView 位置变化的最小时间间隔,默认为 20。
  • forExposureCheck:单位 fps,指定检测目标节点可见性的最小时间间隔,默认为 20.

返回值

无(undefined)。

注意事项

LynxView 不会有位置变化时,如全页场景,可以设置 forPageRect0 来停止检测 LynxView 的位置变化。然而,在卡片场景,设置 forPageRect0 会导致 Lynx 卡片在滑动场景下曝光失效,具体参考曝光能力

兼容性

LCD tables only load in the browser

除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。