Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.41.4"
}
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.41.4'
cache: true
- run: flutter pub get
- run: flutter analyze

build-android:
name: Build example APK (release)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.41.4'
cache: true
- name: Install example deps
working-directory: example
run: flutter pub get
- name: Build release APK
working-directory: example
run: flutter build apk --release
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
GeneratedPluginRegistrant.java
build/
.flutter-plugins
.flutter-plugins

# FVM Version Cache
.fvm/
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.1.5 (hm-toan fork)

- fix(android): remove hardcoded `io.flutter:flutter_embedding_debug` with stale
engine hash — Flutter tool auto-injects the correct embedding variant via
`flutter.gradle`. Hardcoding it broke `releaseCompileClasspath` resolution
on current Flutter SDKs.

## 3.1.4

- Removes references to v1 Flutter Android embedding classes.
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# video_compress

> **Fork notice (hm-toan):** Fork of [jonataslaw/VideoCompress](https://github.com/jonataslaw/VideoCompress) maintained for Flutter 3.41+ compatibility.
>
> Changes vs upstream:
> - AGP 8.11.1, Kotlin 1.9.10, compileSdk 35 (16 KB page-size support)
> - Transcoder bumped to 0.11.2
> - Drops hardcoded `io.flutter:flutter_embedding_debug` (broke `releaseCompileClasspath` on current Flutter SDKs)
>
> Consume via git ref, e.g. in `pubspec.yaml`:
> ```yaml
> dependency_overrides:
> video_compress:
> git:
> url: https://github.com/hm-toan/VideoCompress.git
> ref: v3.1.5
> ```

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.
100% native code was used, we do not use FFMPEG as it is very slow, bloated and the GNU license is an obstacle for commercial applications.
In addition, google chrome uses VP8/VP9, safari uses h264, and most of the time, it is necessary to encode the video in two formats, but not with this library.
Expand Down
24 changes: 9 additions & 15 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ group 'com.example.video_compress'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.9.10'
ext.kotlin_version = '2.1.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.1.1'
classpath 'com.android.tools.build:gradle:8.7.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,35 +26,29 @@ apply plugin: 'kotlin-android'

android {
namespace 'com.example.video_compress'

// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'com.example.video_compress'
}

compileSdk 34
compileSdk 36

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = '17'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 21
minSdk 21
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
lint {
disable 'InvalidPackage'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.otaliastudios:transcoder:0.10.5'
implementation 'com.otaliastudios:transcoder:0.11.2'
}
5 changes: 3 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri May 17 15:24:59 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.video_compress">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class VideoCompressPlugin : MethodCallHandler, FlutterPlugin {
result.success(Utility(channelName).getMediaInfoJson(context, path!!).toString())
}
"deleteAllCache" -> {
result.success(Utility(channelName).deleteAllCache(context, result));
Utility(channelName).deleteAllCache(context, result)
}
"setLogLevel" -> {
val logLevel = call.argument<Int>("logLevel")!!
Expand Down
3 changes: 2 additions & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Mar 18 09:09:19 ICT 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
4 changes: 2 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
id "com.android.application" version "8.11.1" apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
}

include ":app"
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Demonstrates how to use the video_compress plugin.
publish_to: 'none'

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
flutter:
Expand All @@ -20,6 +20,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
video_compress:
path: ../

Expand Down
1 change: 0 additions & 1 deletion lib/src/video_compress/video_compressor.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: video_compress
description: Light library of video manipulation of Flutter. Compress video, remove audio, get video thumbnail from dart code.
version: 3.1.4
homepage: https://github.com/jonataslaw/VideoCompress
version: 3.1.5
homepage: https://github.com/hm-toan/VideoCompress

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down