The most complete doc is available here: https://capgo.app/docs/plugins/screen-recorder/
npm install @capgo/capacitor-screen-recorder
npx cap syncadd NSPhotoLibraryUsageDescription in your info.plist
increase project's minSdk version to 23, it's required by the dependency HBRecorder
Add these permissions in your AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />Add JitPack repository to your Android app's build.gradle (android/app/build.gradle):
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io/' }
}
}This plugin will use the following project variables (defined in your app's variables.gradle file):
$kotlinVersionversion oforg.jetbrains.kotlin:kotlin-stdlib-jdk7(default:1.7.21)
If you have compilation issue Duplicate class androidx.lifecycle.ViewModelLazy
i found in this the solution who worked for me:
https://stackoverflow.com/questions/73406969/duplicate-class-androidx-lifecycle-viewmodellazy-found-in-modules-lifecycle-view
Add this
configurations {
all {
exclude group: 'androidx.lifecycle', module: 'lifecycle-runtime-ktx'
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
}
}
an
line 2 in file android/app/build.gradle
No configuration required for this plugin.
Capacitor Screen Recorder Plugin for recording the device screen. Allows you to capture video recordings of the screen with optional audio.
start(options?: { recordAudio?: boolean | undefined; } | undefined) => Promise<void>Start recording the device screen.
Initiates screen recording with optional audio capture. The user will be prompted to grant screen recording permissions if not already granted. On iOS, the system recording UI will be displayed. On Android, the recording starts immediately after permission is granted.
| Param | Type | Description |
|---|---|---|
options |
{ recordAudio?: boolean; } |
- Recording configuration options |
Since: 1.0.0
stop() => Promise<void>Stop the current screen recording.
Stops the active screen recording and saves the video to the device's camera roll or gallery. On iOS, the system will show a preview of the recording. On Android, the video is saved directly to the gallery.
Since: 1.0.0
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version.
Returns: Promise<{ version: string; }>
Since: 1.0.0
