summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authororionlee <orionlee@yahoo.com>2019-01-03 11:54:06 -0800
committerorionlee <orionlee@yahoo.com>2019-02-27 14:52:34 -0800
commit76fbab8e82195ffa060a3d526fe1e2c90b5da04a (patch)
tree6da488f39f5d02d8c441423af90050b77f71779d /app/src/main
parentf3980091a96f0e399598826f37206d596c1b6815 (diff)
downloadAntennaPod-76fbab8e82195ffa060a3d526fe1e2c90b5da04a.zip
more #2716 - fix VideoPlayback upon hitting home button.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java21
1 files changed, 15 insertions, 6 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 78cc15b2c..d6983eac2 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
@@ -91,12 +91,22 @@ public class VideoplayerActivity extends MediaplayerActivity {
@Override
protected void onStop() {
+ stopPlaybackIfUserPreferencesSpecified(); // MUST be called before super.onStop(), while it still has member variable controller
super.onStop();
if (!PictureInPictureUtil.isInPictureInPictureMode(this)) {
videoControlsHider.stop();
}
}
+ void stopPlaybackIfUserPreferencesSpecified() {
+ if (controller != null && !destroyingDueToReload
+ && UserPreferences.getVideoBackgroundBehavior()
+ != UserPreferences.VideoBackgroundBehavior.CONTINUE_PLAYING) {
+ Log.v(TAG, "stop video playback per UserPreference");
+ controller.notifyVideoSurfaceAbandoned();
+ }
+ }
+
@Override
public void onUserLeaveHint () {
if (!PictureInPictureUtil.isInPictureInPictureMode(this) && UserPreferences.getVideoBackgroundBehavior()
@@ -275,13 +285,12 @@ public class VideoplayerActivity extends MediaplayerActivity {
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
- Log.d(TAG, "Videosurface was destroyed");
+ Log.d(TAG, "Videosurface was destroyed." );
+ Log.v(TAG, " hasController=" + (controller != null)
+ + " , destroyingDueToReload=" + destroyingDueToReload
+ + " , videoBackgroundBehavior=" + UserPreferences.getVideoBackgroundBehavior());
videoSurfaceCreated = false;
- if (controller != null && !destroyingDueToReload
- && UserPreferences.getVideoBackgroundBehavior()
- != UserPreferences.VideoBackgroundBehavior.CONTINUE_PLAYING) {
- controller.notifyVideoSurfaceAbandoned();
- }
+ stopPlaybackIfUserPreferencesSpecified();
}
};