diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2021-02-16 09:39:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 09:39:23 +0100 |
commit | 0f692be2d439316aea68aeb7d83db261ebbaa8de (patch) | |
tree | ca5fb6560078a6aa1f799a284658aa188ce5f5c8 /core | |
parent | fe0c710bc8e95a9fc949ee842f69bd399ada838a (diff) | |
parent | 57587c928e06af39dc3391537b526d515f848410 (diff) | |
download | AntennaPod-0f692be2d439316aea68aeb7d83db261ebbaa8de.zip |
Merge pull request #4940 from ByteHamster/more-reliable-chapters
More reliable chapter loading
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index ae8d1a45e..fb37222f7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -51,7 +51,7 @@ import java.util.List; * Communicates with the playback service. GUI classes should use this class to * control playback instead of communicating with the PlaybackService directly. */ -public class PlaybackController { +public abstract class PlaybackController { private static final String TAG = "PlaybackController"; private static final int INVALID_TIME = -1; @@ -193,7 +193,6 @@ public class PlaybackController { bound = activity.bindService(optionalIntent.get(), mConnection, 0); } else { status = PlayerStatus.STOPPED; - setupGUI(); handleStatus(); } } else { @@ -331,8 +330,6 @@ public class PlaybackController { } }; - public void setupGUI() {} - public void onPositionObserverUpdate() {} @@ -431,7 +428,10 @@ public class PlaybackController { } private void checkMediaInfoLoaded() { - mediaInfoLoaded = (mediaInfoLoaded || loadMediaInfo()); + if (!mediaInfoLoaded) { + loadMediaInfo(); + } + mediaInfoLoaded = true; } private void updatePlayButtonAppearance(int resource, CharSequence contentDescription) { @@ -446,9 +446,7 @@ public class PlaybackController { return null; } - public boolean loadMediaInfo() { - return false; - } + public abstract void loadMediaInfo(); public void onAwaitingVideoSurface() {} @@ -463,10 +461,9 @@ public class PlaybackController { status = info.playerStatus; media = info.playable; - setupGUI(); - handleStatus(); // make sure that new media is loaded if it's available mediaInfoLoaded = false; + handleStatus(); } else { Log.e(TAG, |