> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# lynx: setObserverFrameRate() static method

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

## 语法

```ts
setObserverFrameRate(options?: Options): void;
```

### 参数

#### options

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

指定曝光检测频率：

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

### 返回值

无（`undefined`）。

### 注意事项

当 `LynxView` 不会有位置变化时，如全页场景，可以设置 `forPageRect` 为 `0` 来停止检测 `LynxView` 的位置变化。然而，在卡片场景，设置 `forPageRect` 为 `0` 会导致 `Lynx` 卡片在滑动场景下曝光失效，具体参考[曝光能力](/next/zh/guide/interaction/visibility-detection/exposure-ability.md)。

## 兼容性

**Compatibility Table**

**Query:** `lynx-api.lynx.setObserverFrameRate`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/lynx/setObserverFrameRate.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| setObserverFrameRate | Yes (2.15) | Yes (3.4) | Yes (2.15) | Yes (3.5) | Yes (3.5) | No |

**`setObserverFrameRate`**

Set the frequency of exposure detection.

