Skip an unresolvable Next Up episode instead of stalling playback (issue #240) - #241
Merged
Merged
Conversation
…sue #240) playNextQueued() used to give up silently if the queue's front entry couldn't be resolved -- most commonly the mobile-data streaming gate blocking an undownloaded episode with no UI to confirm from in the background. That left the player parked on the just-finished episode and permanently blocked the queue, since the unplayable entry was never moved out of the front slot. Mirrors onPlayerError's existing handling of a broken episode: move the unresolvable entry to the back of the queue and recurse to try the one after it, bounded by MAX_ADVANCE_ATTEMPTS so an entirely unplayable queue can't loop forever.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PlaybackService.playNextQueued()used to give up silently when the queue's front entry couldn't be resolved -- most commonly the mobile-data streaming gate (issue Warn and let the user override at play-time instead of a blanket disable-streaming-on-mobile-data toggle #222) blocking an undownloaded episode with no UI to confirm from in the background, or a dangling queue entry pointing at a deletedFeedItem.STATE_ENDED) and permanently blocked the queue, since the unplayable entry was never moved out of the front slot -- explains the intermittent "doesn't move on to the next episode" symptom, since it depends on whether the next queued episode happens to be downloaded/on Wi-Fi at that moment.onPlayerError's existing handling of a genuinely broken episode: moves the unresolvable entry to the back of the queue (or drops it outright if itsFeedItemrow is gone) and recurses to try the entry after it, bounded byMAX_ADVANCE_ATTEMPTSso a queue that's entirely unplayable right now can't recurse forever.Closes #240
Test plan
./gradlew assembleDebug testDebugUnitTest lintDebugPlaybackServicedirectly (it's aMediaSessionServicewired to a realExoPlayer) -- not adding new test scaffolding for it here since none of the existing playback tests attempt that and it'd be a larger undertaking than this fix warrants