diff --git a/android/build.gradle b/android/build.gradle
index 48ee005..f6c2837 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -2,7 +2,7 @@ group 'com.steelkiwi.videotrimming'
version '1.0-SNAPSHOT'
buildscript {
- ext.kotlin_version = '1.3.50'
+ ext.kotlin_version = '1.6.20'
repositories {
google()
jcenter()
@@ -30,7 +30,7 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
- compileSdkVersion 31
+ compileSdkVersion 33
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@@ -38,13 +38,14 @@ android {
defaultConfig {
minSdkVersion
multiDexEnabled true
- minSdkVersion 26
- targetSdkVersion 31
+ minSdkVersion 27
+ targetSdkVersion 33
}
lintOptions {
disable 'InvalidPackage'
}
+
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 01a286e..cb24abd 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index df1e830..a537a49 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -1,13 +1,14 @@
-
-
-
-
+
@@ -15,10 +16,12 @@
-
-
+
+
-
-
\ No newline at end of file
+
diff --git a/android/src/main/kotlin/com/steelkiwi/videotrimming/VideotrimmingPlugin.kt b/android/src/main/kotlin/com/steelkiwi/videotrimming/VideotrimmingPlugin.kt
index fe00038..9430d0d 100644
--- a/android/src/main/kotlin/com/steelkiwi/videotrimming/VideotrimmingPlugin.kt
+++ b/android/src/main/kotlin/com/steelkiwi/videotrimming/VideotrimmingPlugin.kt
@@ -29,7 +29,7 @@ public class VideotrimmingPlugin : FlutterPlugin, MethodCallHandler, ActivityAwa
fun registerWith(registrar: Registrar) {
val plugin = VideotrimmingPlugin()
plugin.setupEngine(registrar.messenger())
- val delegate: VideoTrimDelegate = plugin.setupActivity(registrar.activity())!!
+ val delegate: VideoTrimDelegate = registrar.activity()?.let { plugin.setupActivity(it) }!!
registrar.addActivityResultListener(delegate)
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index 5c7dce8..2efc925 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -23,11 +23,11 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
+
android {
- compileSdkVersion 31
+ compileSdkVersion 33
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@@ -36,12 +36,19 @@ android {
lintOptions {
disable 'InvalidPackage'
}
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+
+ sourceSets {
+ main.java.srcDirs += 'src/main/kotlin'
+ }
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.steelkiwi.videotrimming_example"
- minSdkVersion 26
- targetSdkVersion 31
+ minSdkVersion 27
+ targetSdkVersion 33
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index 8d8f802..ca2e5dd 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -1,47 +1,43 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+package="com.steelkiwi.videotrimming_example">
+
+
+
+
+
-
+ android:name="io.flutter.embedding.android.SplashScreenDrawable"
+ android:resource="@drawable/launch_background"
+ />
+
+
+
+
+
+
+
+
+
diff --git a/example/android/build.gradle b/example/android/build.gradle
index a6b142b..211c3f1 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -1,13 +1,12 @@
-
buildscript {
- ext.kotlin_version = '1.3.50'
+ ext.kotlin_version = '1.6.20'
repositories {
google()
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.1.2'
+ classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties
index 59dd2e1..d3b76b2 100644
--- a/example/android/gradle/wrapper/gradle-wrapper.properties
+++ b/example/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
diff --git a/example/android/settings.gradle b/example/android/settings.gradle
index d3b6a40..44e62bc 100644
--- a/example/android/settings.gradle
+++ b/example/android/settings.gradle
@@ -1,7 +1,3 @@
-// Copyright 2014 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 35e4e32..1b49399 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -25,7 +25,7 @@ class MyHomePage extends StatefulWidget {
}
class _MyHomePageState extends State {
- VideoPlayerController? _controller;
+ VideoPlayerController? _controller;
String selectedPath = "";
String trimmedPath = "";
@@ -48,9 +48,9 @@ class _MyHomePageState extends State {
height: 200,
width: 200,
),
- new RaisedButton(
+ new GestureDetector(
child: new Text('Select video'),
- onPressed: () {
+ onTap: () {
_pickVideo();
},
),
@@ -62,8 +62,7 @@ class _MyHomePageState extends State {
_pickVideo() async {
if (await Permission.storage.request().isGranted) {
- FilePickerResult? selectedFile =
- await FilePicker.platform.pickFiles(type: FileType.video);
+ FilePickerResult? selectedFile = await FilePicker.platform.pickFiles(type: FileType.video);
selectedPath = selectedFile?.files.single.path ?? "";
var trimmedFile = await VideoTrimming.trimVideo(sourcePath: selectedPath);
diff --git a/example/pubspec.lock b/example/pubspec.lock
index 44f6724..9ff77ce 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
- version: "2.8.2"
+ version: "2.9.0"
boolean_selector:
dependency: transitive
description:
@@ -21,28 +21,21 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
- charcode:
- dependency: transitive
- description:
- name: charcode
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.1"
+ version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
+ version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
- version: "1.15.0"
+ version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
@@ -56,7 +49,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.3.1"
ffi:
dependency: transitive
description:
@@ -99,28 +92,35 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
- version: "0.6.3"
+ version: "0.6.4"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
- version: "0.12.11"
+ version: "0.12.12"
+ material_color_utilities:
+ dependency: transitive
+ description:
+ name: material_color_utilities
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
- version: "1.7.0"
+ version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.0"
+ version: "1.8.2"
permission_handler:
dependency: "direct main"
description:
@@ -153,7 +153,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.1"
+ version: "1.9.0"
stack_trace:
dependency: transitive
description:
@@ -174,35 +174,28 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
+ version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
- version: "0.4.3"
- typed_data:
- dependency: transitive
- description:
- name: typed_data
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.0"
+ version: "0.4.12"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.0"
+ version: "2.1.2"
video_player:
dependency: "direct main"
description:
@@ -232,5 +225,5 @@ packages:
source: path
version: "0.0.1"
sdks:
- dart: ">=2.12.0 <3.0.0"
+ dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.0.0"
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 39afaa0..60f28e5 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Jun 15 18:14:48 EEST 2020
+#Thu Sep 22 16:59:17 EEST 2022
distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
+zipStoreBase=GRADLE_USER_HOME
diff --git a/pubspec.lock b/pubspec.lock
index 581235f..24c46bc 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
- version: "2.8.2"
+ version: "2.9.0"
boolean_selector:
dependency: transitive
description:
@@ -21,35 +21,28 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
- charcode:
- dependency: transitive
- description:
- name: charcode
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.1"
+ version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
+ version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
- version: "1.15.0"
+ version: "1.16.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
@@ -66,21 +59,28 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
- version: "0.12.11"
+ version: "0.12.12"
+ material_color_utilities:
+ dependency: transitive
+ description:
+ name: material_color_utilities
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
- version: "1.7.0"
+ version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.0"
+ version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
@@ -92,7 +92,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.1"
+ version: "1.9.0"
stack_trace:
dependency: transitive
description:
@@ -113,35 +113,28 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
+ version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
- version: "0.4.3"
- typed_data:
- dependency: transitive
- description:
- name: typed_data
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.0"
+ version: "0.4.12"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.0"
+ version: "2.1.2"
sdks:
- dart: ">=2.12.0 <3.0.0"
+ dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0"