Skip to content

Commit

Permalink
change default option
Browse files Browse the repository at this point in the history
  • Loading branch information
jonataslaw committed Mar 29, 2020
1 parent e750bc3 commit dab1852
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
## 0.1.0
- initial release


## 0.1.1
- Change default value to HD

## 0.1.2
- Removed unecessary intent when process is done
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,9 @@ class VideoCompressPlugin private constructor(private val activity: Activity, pr

when (quality) {

// 0 -> {
// strategy: TrackStrategy = DefaultVideoStrategy.Builder()
// .keyFrameInterval(3f)
// .bitRate(1280 * 720 * 4.toLong())
// .frameRate(30) // will be capped to the input frameRate
// .build()
// }
0 -> {
strategy = DefaultVideoStrategy.atMost(720).build()
}

1 -> {
strategy = DefaultVideoStrategy.atMost(340).build()
Expand All @@ -97,17 +93,12 @@ class VideoCompressPlugin private constructor(private val activity: Activity, pr
.setListener(object : TranscoderListener {
override fun onTranscodeProgress(progress: Double) {}
override fun onTranscodeCompleted(successCode: Int) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(destPath))
intent.setDataAndType(Uri.parse(destPath), "video/mp4")
activity.startActivity(intent)

val json = Utility(channelName).getMediaInfoJson(context, destPath)
json.put("isCancel", false)
result.success(json.toString())
if (deleteOrigin) {
File(path).delete()
}

}

override fun onTranscodeCanceled() {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: video_compress
description: Light library of video manipulation of Flutter. Compress video, remove audio, get video thumbnail from dart code.
version: 0.1.0
version: 0.1.2
homepage: https://github.com/jonataslaw

environment:
Expand Down

0 comments on commit dab1852

Please sign in to comment.