fix(live-tv): contain retry failures

This commit is contained in:
edde746
2026-07-12 08:42:23 +02:00
parent a0f153e5ab
commit 69cf5fb8a1
7 changed files with 196 additions and 20 deletions
+15 -6
View File
@@ -22,12 +22,21 @@ extension _VideoPlayerErrorMethods on VideoPlayerScreenState {
// Live TV: retry with progressively degraded stream settings
// (mirrors Plex web client fallback chain).
if (widget.isLive && _live.fallbackLevel < 2 && !_live.retrying) {
_live.fallbackLevel++;
_live.retrying = true;
appLogger.w('Live stream failed, retrying with fallback level $_live.fallbackLevel');
_retryLiveStream().whenComplete(() => _live.retrying = false);
return;
if (widget.isLive) {
// The bounded retry operation owns errors raised while applying/opening
// its replacement stream. Do not let the same error close the route.
if (_live.retrying) return;
if (_live.fallbackLevel < 2) {
_live.fallbackLevel++;
_live.retrying = true;
appLogger.w('Live stream failed, retrying with fallback level $_live.fallbackLevel');
unawaited(_retryLiveStream());
return;
}
if (_live.retryFailed) {
showGlobalErrorSnackBar(t.messages.streamInterrupted);
return;
}
}
showGlobalErrorSnackBar(_redactPlayerError(_lastLogError ?? err.message));