triniwiz / nativescript-videorecorder

:video_camera: NativeScript plugin for Video Recording . :video_camera:
Apache License 2.0
43 stars 29 forks source link

the plugin does not work with androidX #69

Closed Jmchemama closed 4 years ago

Jmchemama commented 5 years ago

In the file videorecorder.android.js change

} else {
        path = app.android.currentContext
          .getExternalFilesDir(null)
          .getAbsolutePath();
      }

file = new java.io.File(path + '/' + fileName);·
if (sdkVersionInt >= 21) {
 tempPictureUri =(android.support.v4.content)).FileProvider.FileProvider.getUriForFile(app.android.foregroundActivity, pkgName + ".provider", file);
}

to

else {
        path = app.android.context
          .getExternalFilesDir(null)
          .getAbsolutePath();
}
file = new java.io.File(path + '/' + fileName);
if (sdkVersionInt >= 21) {
tempPictureUri = androidx.core.content.FileProvider.getUriForFile(app.android.foregroundActivity, pkgName + ".provider", file);
}