From fc5e295c3b045d750dc88edfe71249368d58211c Mon Sep 17 00:00:00 2001 From: Rob Walch Date: Tue, 9 May 2023 08:29:12 -0400 Subject: [PATCH] Allow live level loading to recover from net::ERR_NETWORK_IO_SUSPENDED errors (#5473) --- src/controller/error-controller.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/controller/error-controller.ts b/src/controller/error-controller.ts index e0742e8ed0c..030181c0557 100644 --- a/src/controller/error-controller.ts +++ b/src/controller/error-controller.ts @@ -255,21 +255,12 @@ export default class ErrorController implements NetworkComponentAPI { retryCount, }; } - // Do not perform level switch if an error occurred using delivery directives - // Allow reload without directives (handled in playlist-loader) - if (data.context?.deliveryDirectives) { - return { - action: NetworkErrorAction.DoNothing, - flags: ErrorActionFlags.None, - retryConfig: retryConfig || { - maxNumRetry: 0, - retryDelayMs: 0, - maxRetryDelayMs: 0, - }, - retryCount, - }; + const errorAction = this.getLevelSwitchAction(data, levelIndex); + if (retryConfig) { + errorAction.retryConfig = retryConfig; + errorAction.retryCount = retryCount; } - return this.getLevelSwitchAction(data, levelIndex); + return errorAction; } private getFragRetryOrSwitchAction(data: ErrorData): IErrorAction {