diff options
author | orionlee <orionlee@yahoo.com> | 2019-03-09 14:16:53 -0800 |
---|---|---|
committer | orionlee <orionlee@yahoo.com> | 2019-03-09 14:16:53 -0800 |
commit | 6f7b937d07642dc455e59a674a4f0d28784e0504 (patch) | |
tree | 99a88d7da9bfeb4bdd91ceeaf8d2d7aad3eff6f5 /app/src/main | |
parent | 7a905c057025f877b56de95539da9a0768e016f9 (diff) | |
download | AntennaPod-6f7b937d07642dc455e59a674a4f0d28784e0504.zip |
bugfix - video playback upon press back button (and pause), playback notification might reappear if one swipes it away quickly.
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index d6983eac2..fa5012b74 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -47,6 +47,7 @@ public class VideoplayerActivity extends MediaplayerActivity { */ private boolean videoControlsShowing = true; private boolean videoSurfaceCreated = false; + private boolean playbackStoppedUponExitVideo = false; private boolean destroyingDueToReload = false; private VideoControlsHider videoControlsHider = new VideoControlsHider(this); @@ -77,6 +78,7 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void onResume() { super.onResume(); + playbackStoppedUponExitVideo = false; if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { playExternalMedia(getIntent(), MediaType.VIDEO); } else if (PlaybackService.isCasting()) { @@ -99,6 +101,16 @@ public class VideoplayerActivity extends MediaplayerActivity { } void stopPlaybackIfUserPreferencesSpecified() { + // to avoid the method being called twice during leaving Videoplayer + // , which will double-pause the media + // (it is usually first called by surfaceHolderCallback.surfaceDestroyed(), + // then VideoplayerActivity.onStop() , but sometimes VideoplayerActivity.onStop() + // will first be invoked.) + if (playbackStoppedUponExitVideo) { + return; + } + playbackStoppedUponExitVideo = true; + if (controller != null && !destroyingDueToReload && UserPreferences.getVideoBackgroundBehavior() != UserPreferences.VideoBackgroundBehavior.CONTINUE_PLAYING) { |