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