Skip to content

Commit 18d6448

Browse files
authored
Re-render controls when lastError changes (#617)
1 parent bec14d7 commit 18d6448

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core-web/src/media/controls/controller.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ const addEffectsToStore = (
368368
backoffMax: __initialProps.backoffMax,
369369
calculateDelay: __initialProps.calculateDelay,
370370
errorCount,
371+
lastError: __controls.lastError,
371372
hlsConfig: __controls.hlsConfig,
372373
mounted,
373374
progress,
@@ -382,6 +383,7 @@ const addEffectsToStore = (
382383
backoffMax,
383384
calculateDelay,
384385
errorCount,
386+
lastError,
385387
hlsConfig,
386388
mounted,
387389
progress,
@@ -590,12 +592,13 @@ const addEffectsToStore = (
590592
equalityFn: (a, b) => {
591593
const errorCountChanged =
592594
a.errorCount !== b.errorCount && b.errorCount !== 0;
595+
const lastErrorChanged = a.lastError !== b.lastError;
593596

594597
const sourceChanged = a.source?.src !== b.source?.src;
595598
const mountedChanged = a.mounted !== b.mounted;
596599

597600
const shouldReRender =
598-
errorCountChanged || sourceChanged || mountedChanged;
601+
errorCountChanged || lastErrorChanged || sourceChanged || mountedChanged;
599602

600603
return !shouldReRender;
601604
},

0 commit comments

Comments
 (0)