Merge pull request #3881 from ByteHamster/fix-resume-streaming

Fixed resuming when episode was streamed
This commit is contained in:
H. Lehmann 2020-02-23 19:05:39 +01:00 committed by GitHub
commit a7efede66c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -643,7 +643,18 @@ public class PlaybackService extends MediaBrowserServiceCompat {
private void startPlayingFromPreferences() { private void startPlayingFromPreferences() {
Playable playable = Playable.PlayableUtils.createInstanceFromPreferences(getApplicationContext()); Playable playable = Playable.PlayableUtils.createInstanceFromPreferences(getApplicationContext());
if (playable != null) { if (playable != null) {
mediaPlayer.playMediaObject(playable, false, true, true); if (PlaybackPreferences.getCurrentEpisodeIsStream() && !NetworkUtils.isStreamingAllowed()) {
displayStreamingNotAllowedNotification(
new PlaybackServiceStarter(this, playable)
.prepareImmediately(true)
.startWhenPrepared(true)
.shouldStream(true)
.getIntent());
PlaybackPreferences.writeNoMediaPlaying();
stateManager.stopService();
return;
}
mediaPlayer.playMediaObject(playable, PlaybackPreferences.getCurrentEpisodeIsStream(), true, true);
stateManager.validStartCommandWasReceived(); stateManager.validStartCommandWasReceived();
PlaybackService.this.updateMediaSessionMetadata(playable); PlaybackService.this.updateMediaSessionMetadata(playable);
} else { } else {