This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
flavorDimensions "version" | |
productFlavors { | |
demo { | |
dimension "version" | |
firebaseAppDistribution { | |
releaseNotes="Release notes for demo version" | |
testers="demo@testers.com" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply plugin: 'com.google.firebase.appdistribution' | |
buildscript { | |
repositories { | |
google() | |
} | |
dependencies { | |
classpath 'com.google.firebase:firebase-appdistribution-gradle:1.4.0' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
videoCropper.setVideoURI(Uri.parse(path)) | |
.setOnCropVideoListener(this) | |
.setMinMaxRatios(0.3f, 3f) | |
.setDestinationPath(Environment.getExternalStorageDirectory().toString() + File.separator + "temp" + File.separator + "Videos" + File.separator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.video.trimmer.view.VideoCropper | |
android:id="@+id/videoCropper" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:layout_below="@+id/header"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
videoTrimmer.setTextTimeSelectionTypeface(FontsHelper[this, FontsConstants.SEMI_BOLD]) | |
.setOnTrimVideoListener(this) | |
.setOnVideoListener(this) | |
.setVideoURI(Uri.parse(path)) | |
.setVideoInformationVisibility(true) | |
.setMaxDuration(10) | |
.setMinDuration(2) | |
.setDestinationPath(Environment.getExternalStorageDirectory().toString() + File.separator + "temp" + File.separator + "Videos" + File.separator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.video.trimmer.view.VideoTrimmer | |
android:id="@+id/videoTrimmer" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:layout_below="@+id/header"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity(), OnTrimVideoListener { | |
... | |
override fun onCropStarted(){ | |
} | |
override fun getResult(uri: Uri){ | |
} | |
override fun cancelAction(){ | |
} | |
override fun onError(message: String){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity(), OnTrimVideoListener { | |
... | |
override fun onTrimStarted(){ | |
} | |
override fun getResult(uri: Uri){ | |
} | |
override fun cancelAction(){ | |
} | |
override fun onError(message: String){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val command = arrayOf("-i", inputPath, "-vf", "scale=$width:$height", outputPath) //iw:ih |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BackgroundExecutor.execute(object : BackgroundExecutor.Task("", 0L, "") { | |
override fun execute() { | |
try { | |
val threshold = 11 | |
val thumbnailList = LongSparseArray<Bitmap>() | |
val mediaMetadataRetriever = MediaMetadataRetriever() | |
mediaMetadataRetriever.setDataSource(context, mVideoUri) | |
val videoLengthInMs = (Integer.parseInt(mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)) * 1000).toLong() | |
val frameHeight = mHeightView | |
val initialBitmap = mediaMetadataRetriever.getFrameAtTime(0, MediaMetadataRetriever.OPTION_CLOSEST_SYNC) |