From 28578e1deac922fe8e1e81d388ccc967d7304b30 Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Wed, 21 May 2025 15:11:32 +0300 Subject: [PATCH] refactor(Player): reset global var --- src/routes/Player/Player.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/Player/Player.js b/src/routes/Player/Player.js index f1e0657d9..48218d126 100644 --- a/src/routes/Player/Player.js +++ b/src/routes/Player/Player.js @@ -404,6 +404,8 @@ const Player = ({ urlParams, queryParams }) => { // we explicitly set it to a global variable so we can access it in the onEnded function // this is not a good solution but it works for now window.playerNextVideo = player.nextVideo; + } else { + window.playerNextVideo = null; } }, [player.nextVideo, video.state.time, video.state.duration]);