cordova-android-media-projection

0.0.3 • Public • Published

Cordova Media Projection

Cordova Media Projection is to capture device screen in real time and show it on a Surface-View.

Installation

Latest stable version from npm:

$ cordova plugin add cordova-android-media-projection

Bleeding edge version from Github:

$ cordova plugin add https://github.com/disono/cordova-android-media-projection

Using the plugin

Call start() to start recording screen. Stopping the recording will return path(/storage/emulated/0/Download/video-xxxxxxxxx.mp4) of video record.

mediaProjection.start([successCallback], [failureCallback]);
 
mediaProjection.stop([successCallback], [failureCallback]);

Example

mediaProjection.start();
 
mediaProjection.stop(function (video_path) {
    console.log('Save Recording Path: ' + video_path);
}function (e) {
    console.error('Error: ' + e);
});

Note

1. It cannot be used on API version lower than 21
2. Update your config.xml and add this <preference name="android-minSdkVersion" value="21" />
3. Minimum supported Gradle version is 3.3 (Update the GradleBuilder.js find the distributionUrl and replace with var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'|| 'https\\://services.gradle.org/distributions/gradle-3.3-all.zip';)

License

Cordova Media Projection is licensed under the Apache License (ASL) license. For more information, see the LICENSE file in this repository.

Package Sidebar

Install

npm i cordova-android-media-projection

Weekly Downloads

1

Version

0.0.3

License

Apache 2.0

Last publish

Collaborators

  • master_chie