开始使用
复制一个设置提示,包含安装步骤和该插件的完整 Markdown 指南。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-screen-recorder`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/screen-recorder/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
bun add @capgo/capacitor-screen-recorderbunx cap syncimport { ScreenRecorder } from '@capgo/capacitor-screen-recorder';API 介绍
Section titled “API 介绍”start
Section titled “开始”开始记录设备屏幕。
开始屏幕录制,支持音频捕获。用户将被要求授予屏幕录制权限,如果权限已被授予则不再提示。iOS 中会显示系统录制 UI,Android 中录制会在权限被授予后立即开始。
import { ScreenRecorder } from '@capgo/capacitor-screen-recorder';
// Start recording without audioawait ScreenRecorder.start();
// Start recording with audioawait ScreenRecorder.start({ recordAudio: true });停止当前屏幕录制。
停止活动的屏幕录制并将视频保存到设备的相册或相机胶卷中。iOS 中会显示录制预览,Android 中视频直接保存到相册中。
import { ScreenRecorder } from '@capgo/capacitor-screen-recorder';
await ScreenRecorder.stop();console.log('Recording saved to gallery');真实数据来源
真实数据来源该页面是由插件生成的 src/definitions.ts当公共API上游发生变化时,请重新同步。