For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/js-api/device/screen/onUserScreenRecord.md.

onUserScreenRecord

监听用户录屏事件。

扫码预览

扫码预览 onUserScreenRecord

支持版本

前端库版本不低于 0.0.37。

支持平台

平台支持情况
Android支持
iOS支持
PC不支持
HarmonyOS不支持

支持场景

场景支持情况
页面支持
卡片不支持

使用说明

  • iOS 订阅成功后会立即回报一次当前录屏状态

调用方式

事件监听 API

onUserScreenRecord(callback: (event: UserScreenRecordEvent) => void): () => void

入参

无。

调用示例

import { onUserScreenRecord } from '@doubao-dev/framework/api';

const off = onUserScreenRecord(({ state }) => {
  console.log(state);
});

off();

回调参数

名称类型必返说明
event.stateUserScreenRecordState是录屏状态,start 表示开始录屏,stop 表示停止录屏。

返回值

返回取消当前监听函数的函数。

回调示例

{
  "state": "start"
}

平台差异

  • Android:仅 Android 15 及以上上报录屏事件,低版本不生效