Home > Software engineering >  I need to crop a video from the local storage and put the file in local storage in android is there
I need to crop a video from the local storage and put the file in local storage in android is there

Time:02-08

I need to crop a video from the local storage and put the file in local storage in android is there any simple implementation?

CodePudding user response:

You can use this library. You can implement it this way

Usage

  1. Include the library as local library project.
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.VRGsoftUA:VideoCrop:1.0'
}
  1. In code you need to start Activityfor result like so:
startActivityForResult(VideoCropActivity.createIntent(this, inputPath, outputPath), CROP_REQUEST);
  1. Then catch result in onActivityResult callback
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if(requestCode == CROP_REQUEST && resultCode == RESULT_OK){
            //crop successful
        }
    }
  •  Tags:  
  • Related