Screen Recorder (Android Only)

Hi, recently i found an awesome plugin regarding screen recording with or without audio for Android.

I had added some modifications and features to the plugin, such as pause and resume functionalities.

Check it out Ionic 2/3 screen recorder plugin. Currently only works for Android.

Kenny

Build fail :frowning

Do you follow the instructions at my github repo ? and it will be good to show whats the error :slight_smile:
Do pm me for more, as this section is for demo only.

mediaProjection, file.getAbsolutePath());
^
symbol: class MediaRecordService
location: class ScreenRecord
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.
/app/platforms/android/src/com/unionpay/screenrecord/ScreenRecord.java:22: error: cannot find symbol
import com.unionpay.screenrecord.MediaRecordService;
^
symbol: class MediaRecordService
location: package com.unionpay.screenrecord
/app/platforms/android/src/com/unionpay/screenrecord/ScreenRecord.java:36: error: cannot find symbol
public MediaRecordService mediaRecord;
^
symbol: class MediaRecordService
location: class ScreenRecord
/app/platforms/android/src/com/unionpay/screenrecord/ScreenRecord.java:135: error: cannot find symbol
mediaRecord = new MediaRecordService(width, height, bitRate, dpi, mediaProjection, file.getAbsolutePath());
^
symbol: class MediaRecordService
location: class ScreenRecord
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors

FAILURE: Build failed with an exception.

Thanks if you can help me solve this problem!!

copy MediaRecordService.java file from plugin and paste inside /app/platforms/android/src/com/unionpay/screenrecord/

1 Like

Hi…
I con’t able to build and i am trying to install cordova/argscheck and cordova/argscheck but it’s asking the git username and password can you please help me on this, I have attached the screenshot for your reference.

ERROR in ./node_modules/cordova-plugin-screenrecord/www/ScreenRecord.js
Module not found: Error: Can’t resolve ‘cordova/argscheck’ in ‘C:\shiva\ionoc4Project\In-app-ionic\ionic4In-app\node_modules\cordova-plugin-screenrecord\www’
ERROR in ./node_modules/cordova-plugin-screenrecord/www/ScreenRecord.js
Module not found: Error: Can’t resolve ‘cordova/exec’ in ‘C:\shiva\ionoc4Project\In-app-ionic\ionic4In-app\node_modules\cordova-plugin-screenrecord\www’
[ERROR] An error occurred while running subprocess ng.

.

I’m facing problem to generate mp4 file. Every thing fine but no mp4 file.

declare let ScreenRecord: any;
record(){
    try{
      ScreenRecord.startRecord(
        {isAudio: true},
        "file:///storage/emulated/0/Android/data/io.ionic.starter/files/test.mp4",
        (success)=> {
          this.recording=true;
          alert(success);
        }, (error)=>{
          alert(error);
        }
      );
    }catch{e=>{

    }}
  }
stop(){
    try{
      ScreenRecord.stopRecord(
        (success)=>{
          this.recording=false;
          alert(success + " : " + "file:///storage/emulated/0/Android/data/io.ionic.starter/files/test.mp4");
        },
        (error)=>{
          alert(error);
        }
      );
    }catch{e=>{

    }}
  }