Merge pull request #4659 from ByteHamster/fix-playback

Fix using wrong playable object
This commit is contained in:
ByteHamster 2020-11-06 22:57:57 +01:00 committed by GitHub
commit 29f46d97c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -517,11 +517,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe( .subscribe(
playableLoaded -> { playableLoaded -> {
mediaPlayer.playMediaObject(playable, stream, startWhenPrepared, mediaPlayer.playMediaObject(playableLoaded, stream, startWhenPrepared,
prepareImmediately); prepareImmediately);
addPlayableToQueue(playable); addPlayableToQueue(playableLoaded);
}, error -> { }, error -> {
Log.d(TAG, "Playable was not found. Stopping service."); Log.d(TAG, "Playable was not found. Stopping service.");
error.printStackTrace();
stateManager.stopService(); stateManager.stopService();
}); });
return Service.START_NOT_STICKY; return Service.START_NOT_STICKY;
@ -729,6 +730,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
addPlayableToQueue(playable); addPlayableToQueue(playable);
}, error -> { }, error -> {
Log.d(TAG, "Playable was not loaded from preferences. Stopping service."); Log.d(TAG, "Playable was not loaded from preferences. Stopping service.");
error.printStackTrace();
stateManager.stopService(); stateManager.stopService();
}); });
} }