开始使用
复制一个包含安装步骤和本插件的完整 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 sync导入
导入import { ScreenRecorder } from '@capgo/capacitor-screen-recorder';API 介绍
API 介绍start
开始开始设备屏幕录制。
开始设备屏幕录制,包括音频捕获。用户将被要求授予屏幕录制权限,如果已授予则不再提示。iOS上将显示系统录制UI,Android上录制将在权限授予后立即开始。
import { ScreenRecorder } from '@capgo/capacitor-screen-recorder';
// Start recording without audioawait ScreenRecorder.start();
// Start recording with audioawait ScreenRecorder.start({ recordAudio: true });stop
标题为“停止”停止当前屏幕录制。
停止当前的屏幕录制并将视频保存到设备的相册或相机胶卷中。 在 iOS 中,系统将显示录制的预览。 在 Android 中,视频直接保存到相册中。
import { ScreenRecorder } from '@capgo/capacitor-screen-recorder';
await ScreenRecorder.stop();console.log('Recording saved to gallery');真实来源
标题为“真实来源”本页面由插件生成。 src/definitions.ts当公共API上游发生变化时,请重新同步。