This commit is contained in:
Yuriy Liskov
2022-07-20 20:55:57 +03:00
parent e0fb9643c4
commit ba41eeb781
3 changed files with 17 additions and 3 deletions

View File

@@ -198,6 +198,10 @@ public class AutoFrameRateManager extends PlayerEventListenerHelper implements A
}
private void maybePausePlayback() {
if (getController() == null) {
return;
}
getController().setAfrRunning(true);
int delayMs = 5_000;

View File

@@ -107,7 +107,7 @@ public class PlaybackPresenter extends BasePresenter<PlaybackView> {
public void setPosition(String timeCode) {
// Check that the user isn't open context menu on suggestion item
if (Utils.isPlayerInForeground(getContext()) && !getView().getController().isSuggestionsShown()) {
if (Utils.isPlayerInForeground(getContext()) && getView() != null && !getView().getController().isSuggestionsShown()) {
getView().getController().setPositionMs(ServiceHelper.timeTextToMillis(timeCode));
} else {
Video video = VideoMenuPresenter.sVideoHolder.get();

View File

@@ -186,7 +186,12 @@ public class WebProxyDialog {
mProxyConfigDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener((view) -> {
((TextView) mProxyConfigDialog.findViewById(R.id.proxy_config_message)).setText("");
Proxy proxy = validateProxyConfigFields();
Proxy proxy = null;
try {
proxy = validateProxyConfigFields();
} catch (IllegalArgumentException e) { // port out of range
e.printStackTrace();
}
if (proxy == null) {
appendStatusMessage(R.string.proxy_application_aborted);
} else {
@@ -211,7 +216,12 @@ public class WebProxyDialog {
});
mProxyConfigDialog.setOnDismissListener(dialog -> {
Proxy proxy = validateProxyConfigFields();
Proxy proxy = null;
try {
proxy = validateProxyConfigFields();
} catch (IllegalArgumentException e) { // port out of range
e.printStackTrace();
}
if (proxy != null) {
Log.d(TAG, "Saving proxy info: " + proxy);
mProxyManager.saveProxyInfoToPrefs(proxy, true);