Skip to content

Commit e79a687

Browse files
committed
chore: use double instead of int in android.
1 parent 1057e32 commit e79a687

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android/src/main/kotlin/com/example/video_compress/VideoCompressPlugin.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ class VideoCompressPlugin : MethodCallHandler, FlutterPlugin {
7878
val path = call.argument<String>("path")!!
7979
val quality = call.argument<Int>("quality")!!
8080
val deleteOrigin = call.argument<Boolean>("deleteOrigin")!!
81-
val startTime = call.argument<Int>("startTime")
82-
val duration = call.argument<Int>("duration")
81+
val startTime = call.argument<Double>("startTime")
82+
val duration = call.argument<Double>("duration")
8383
val includeAudio = call.argument<Boolean>("includeAudio") ?: true
8484
val frameRate = if (call.argument<Int>("frameRate")==null) 30 else call.argument<Int>("frameRate")
8585

@@ -139,7 +139,7 @@ class VideoCompressPlugin : MethodCallHandler, FlutterPlugin {
139139

140140
val dataSource = if (startTime != null || duration != null){
141141
val source = UriDataSource(context, Uri.parse(path))
142-
TrimDataSource(source, (1000 * 1000 * (startTime ?: 0)).toLong(), (1000 * 1000 * (duration ?: 0)).toLong())
142+
TrimDataSource(source, (1000 * 1000 * (startTime ?: 0.0)).toLong(), (1000 * 1000 * (duration ?: 0.0)).toLong())
143143
}else{
144144
UriDataSource(context, Uri.parse(path))
145145
}

0 commit comments

Comments
 (0)