fix(android/player): auto-skip a failed track on load error, not just zero-duration
android / Build + lint + test (push) Successful in 3m47s
android / Build + lint + test (push) Successful in 3m47s
onPlayerError fired a `load_failed` event and the snackbar reporter coalesced
it into "Skipped N unplayable tracks" — but nothing actually skipped, so a
bad/stale track stranded playback while the toast claimed otherwise. Mirror
the zero_duration path: advance to the next item and re-prepare (a load error
leaves the player IDLE), or stop at the end. Forward-only bounds a fully-
unplayable queue. Web parity with 2a8de82a. Issue #968.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -417,6 +417,16 @@ class PlayerController @Inject constructor(
|
|||||||
detail = error.message,
|
detail = error.message,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
// A failed load leaves the player IDLE; advance past the bad
|
||||||
|
// track and re-prepare so one unplayable item doesn't strand
|
||||||
|
// playback (mirrors the zero_duration skip). Forward-only —
|
||||||
|
// stop at the end — bounds a fully-unplayable queue.
|
||||||
|
if (controller.hasNextMediaItem()) {
|
||||||
|
controller.seekToNextMediaItem()
|
||||||
|
controller.prepare()
|
||||||
|
} else {
|
||||||
|
controller.stop()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMediaItemTransition(
|
override fun onMediaItemTransition(
|
||||||
|
|||||||
Reference in New Issue
Block a user