diff options
author | ByteHamster <info@bytehamster.com> | 2019-04-14 13:56:04 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-04-14 13:56:04 +0200 |
commit | 0339ce7bcaef166b4fe952f6bb28e992e7688b46 (patch) | |
tree | bce40c43ca2ead661928e7d461d29793ca2cefa3 /core/src/play | |
parent | 28f424e3c1c4002d1d4df55e2fe308f65afdae7b (diff) | |
download | AntennaPod-0339ce7bcaef166b4fe952f6bb28e992e7688b46.zip |
Do not set player status before player object is created
Diffstat (limited to 'core/src/play')
-rw-r--r-- | core/src/play/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java | 6 | ||||
-rw-r--r-- | core/src/play/java/de/danoeh/antennapod/core/service/playback/RemotePSMP.java | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/core/src/play/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java b/core/src/play/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java index a6b732a4f..85c8a22f5 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java +++ b/core/src/play/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceFlavorHelper.java @@ -174,9 +174,9 @@ public class PlaybackServiceFlavorHelper { } callback.sendNotificationBroadcast(PlaybackService.NOTIFICATION_TYPE_RELOAD, PlaybackService.EXTRA_CODE_CAST); - switchMediaPlayer(new RemotePSMP(context, callback.getMediaPlayerCallback()), - info, - wasLaunched); + RemotePSMP remotePSMP = new RemotePSMP(context, callback.getMediaPlayerCallback()); + switchMediaPlayer(remotePSMP, info, wasLaunched); + remotePSMP.init(); // hardware volume buttons control the remote device volume mediaRouter.setMediaSessionCompat(callback.getMediaSession()); registerWifiBroadcastReceiver(); diff --git a/core/src/play/java/de/danoeh/antennapod/core/service/playback/RemotePSMP.java b/core/src/play/java/de/danoeh/antennapod/core/service/playback/RemotePSMP.java index 487849ef5..f91264c59 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/service/playback/RemotePSMP.java +++ b/core/src/play/java/de/danoeh/antennapod/core/service/playback/RemotePSMP.java @@ -62,7 +62,9 @@ public class RemotePSMP extends PlaybackServiceMediaPlayer { startWhenPrepared = new AtomicBoolean(false); isBuffering = new AtomicBoolean(false); remoteState = MediaStatus.PLAYER_STATE_UNKNOWN; + } + public void init () { try { if (castMgr.isConnected() && castMgr.isRemoteMediaLoaded()) { onRemoteMediaPlayerStatusUpdated(); |