Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27e325a7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Gallery2: Seek to trim start time only once when playing"

parents 1c5d28d8 938e5ef5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ public class TrimVideo extends Activity implements

    private int mTrimStartTime = 0;
    private int mTrimEndTime = 0;
    private boolean mCheckTrimStartTime;
    private int mVideoPosition = 0;
    public static final String KEY_TRIM_START = "trim_start";
    public static final String KEY_TRIM_END = "trim_end";
@@ -177,10 +178,11 @@ public class TrimVideo extends Activity implements
        mVideoPosition = mVideoView.getCurrentPosition();
        // If the video position is smaller than the starting point of trimming,
        // correct it.
        if (mVideoPosition < mTrimStartTime) {
        if (mCheckTrimStartTime && (mVideoPosition < mTrimStartTime)) {
            mVideoView.seekTo(mTrimStartTime);
            mVideoPosition = mTrimStartTime;
        }
        mCheckTrimStartTime = false;
        // If the position is bigger than the end point of trimming, show the
        // replay button and pause.
        if (mVideoPosition >= mTrimEndTime && mTrimEndTime > 0) {
@@ -204,6 +206,7 @@ public class TrimVideo extends Activity implements

    private void playVideo() {
        mVideoView.start();
        mCheckTrimStartTime = true;
        mController.showPlaying();
        setProgress();
    }