Skip to content

Commit a917b21

Browse files
committed
Pause video playback during encoding
1 parent 9b08e48 commit a917b21

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/src/main/java/protect/videotranscoder/activity/MainActivity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ private void executeCutVideoCommand(int startMs, int endMs)
427427

428428
FFmpegResponseHandler handler = new FFmpegResponseHandler(this, successIntent, durationMs, progressDialog);
429429
FFmpegUtil.call(complexCommand, handler);
430+
431+
stopPosition = videoView.getCurrentPosition(); //stopPosition is an int
432+
videoView.pause();
430433
}
431434

432435
/**
@@ -461,6 +464,9 @@ private void executeCompressCommand()
461464
FFmpegResponseHandler handler = new FFmpegResponseHandler(this, successIntent, durationMs, progressDialog);
462465

463466
FFmpegUtil.call(complexCommand, handler);
467+
468+
stopPosition = videoView.getCurrentPosition();
469+
videoView.pause();
464470
}
465471

466472
/**
@@ -507,6 +513,9 @@ private void extractImagesVideo(int startMs, int endMs)
507513
FFmpegResponseHandler handler = new FFmpegResponseHandler(this, successIntent, durationMs, progressDialog);
508514

509515
FFmpegUtil.call(complexCommand, handler);
516+
517+
stopPosition = videoView.getCurrentPosition(); //stopPosition is an int
518+
videoView.pause();
510519
}
511520

512521
/**
@@ -540,6 +549,9 @@ private void extractAudioVideo()
540549
FFmpegResponseHandler handler = new FFmpegResponseHandler(this, successIntent, durationMs, progressDialog);
541550

542551
FFmpegUtil.call(complexCommand, handler);
552+
553+
stopPosition = videoView.getCurrentPosition(); //stopPosition is an int
554+
videoView.pause();
543555
}
544556

545557
/**

0 commit comments

Comments
 (0)