Skip to content

Commit 74e94f7

Browse files
committed
Resume playback in onResume only if not encoding
1 parent b6dabb7 commit 74e94f7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ private void cancelEncode()
426426
}
427427
}
428428

429+
private boolean isEncoding()
430+
{
431+
return cancelButton.getVisibility() == View.VISIBLE;
432+
}
433+
429434
private void stopVideoPlayback()
430435
{
431436
videoView.pause();
@@ -469,7 +474,11 @@ protected void onPause()
469474
protected void onResume()
470475
{
471476
super.onResume();
472-
startVideoPlayback();
477+
478+
if(isEncoding() == false)
479+
{
480+
startVideoPlayback();
481+
}
473482
}
474483

475484
private void setSpinnerSelection(Spinner spinner, Object value)
@@ -673,7 +682,10 @@ public void valueChanged(Number minValue, Number maxValue)
673682
tvLeft.setText(getTime(minValue.intValue()));
674683
tvRight.setText(getTime(maxValue.intValue()));
675684

676-
startVideoPlayback();
685+
if(isEncoding() == false)
686+
{
687+
startVideoPlayback();
688+
}
677689
}
678690
});
679691
}

0 commit comments

Comments
 (0)