From a928b12c447d301d851b7b6796d1342fe00734dc Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Mon, 8 May 2023 21:40:08 +0200 Subject: [PATCH] Fix white background on video refresh When refreshing a /video page, since no player is available, `getCurrentPlayer` will be empty and `bindToPlayer` will crash leading to a redirect with `appRouter.goHome();` This is also the case when navigating with previous then next in the browser. Before that that, the background is set in `viewbeforeshow` using `setBackdropTransparency(TRANSPARENCY_LEVEL.Full);` This will leave unexpected classes in the dom leading to a white background on the main page. This fixes proposes to reset the transparency before going to home using `setBackdropTransparency(TRANSPARENCY_LEVEL.None);` Anyway, this looks a little fragile and a deeper fix may be preferable in the future. Another solution would be to move the `setBackdropTransparency(TRANSPARENCY_LEVEL.Full);` when the player is ready but my understanding of the flow is not enough to now if it would have any unexpected results. --- src/controllers/playback/video/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index c4c662cb9c..3574b5847e 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -1496,6 +1496,7 @@ export default function (view) { dom.addEventListener(document, 'click', onClickCapture, { capture: true }); } } catch (e) { + setBackdropTransparency(TRANSPARENCY_LEVEL.None); // reset state set in viewbeforeshow appRouter.goHome(); } });