Cordova plugin for Android Screen Recording (Screen Capture). This plugin makes it possible to save screen-recording as a video to the device's gallery, it requests neccery permissions when the user starts recording for the first time and creates a notification that is active while the screen is being recorded.
This library is tested with Cordova Android 9.1.0
From the root folder of your Cordova project, run:
cordova plugin add https://github.com/PR-DC/cordova-plugin-screen-recording.git
First, append the following preference to the project's config.xml
document.
<preference name="AndroidXEnabled" value="true" />
Now you can proceed with the app code, start recording with:
ScreenRecord.startRecord(opts, fileName, function success(), function error());
opts
is a JSON object with the following properties:
recordAudio
: whether to record audio or not, defaults tofalse
bitRate
: video bitrate, defaults to6000000
title
: notification title, defaults toScreen Recording
text
: notification text, defaults toScreen recording active...
To stop recording call the following method:
ScreenRecord.stopRecord(function success(), function error());
When recording is stopped video is saved to memory and then you can play the video from the gallery.
An example of Cordova application that uses cordova-plugin-screen-recording is available at: https://github.com/PR-DC/PRDC_TestScreenRecording
Copyright (C) 2022 PR-DC info@pr-dc.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.