Video Editor |
Simple video editor Library contains the following features (cropping/trimming/compressing) videos, using FFmpegKit Libary.
dependencies {
implementation 'com.github.mohamed0017:SimpleVideoEditor:<latest_version>'
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
<com.video.trimmer.view.VideoEditor
android:id="@+id/videoTrimmer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/header"/>
class MainActivity : AppCompatActivity(), OnTrimVideoListener {
...
override fun onTrimStarted(){
}
override fun getResult(uri: Uri){
}
override fun cancelAction(){
}
override fun onError(message: String){
}
override fun onProgress(percentage: Int){
}
}
videoTrimmer.setTextTimeSelectionTypeface(FontsHelper[this, FontsConstants.SEMI_BOLD])
.setOnTrimVideoListener(this)
.setOnVideoListener(this)
.setVideoURI(Uri.parse(path))
.setVideoInformationVisibility(true)
.setMaxDuration(10)
.setMinDuration(2)
.setVideoQuality(VideoQuality.Medium) // set video quality
.setDestinationPath(Environment.getExternalStorageDirectory().path + File.separator + Environment.DIRECTORY_MOVIES)
videoCropper.setVideoURI(Uri.parse(path))
.setOnCropVideoListener(this)
.setMinMaxRatios(0.3f, 3f)
.setDestinationPath(Environment.getExternalStorageDirectory().path + File.separator + Environment.DIRECTORY_MOVIES)
Voila! You have implemented an awesome Video Editor for your Android Project now!