From 5c86a13fb437a80d7cc5068d11e37f0c9c4f27f7 Mon Sep 17 00:00:00 2001 From: Marcin Date: Sat, 9 Dec 2023 16:18:59 +0100 Subject: [PATCH] Added a visibility change event listener to reload the page when it is brought back from a hidden state. This is useful when the TV is turned off and then turned on, but the application is not killed by the TV. The state of the main page becomes stale, and the latest updates to the video progress are not visible. --- tizen.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tizen.js b/tizen.js index 51c85dd..4d02a6b 100644 --- a/tizen.js +++ b/tizen.js @@ -179,6 +179,12 @@ } }; + window.addEventListener('visibilitychange', function () { + if (!document.hidden) { + window.location.reload(); + } + }); + window.addEventListener('load', function () { tizen.tvinputdevice.registerKey('MediaPlay'); tizen.tvinputdevice.registerKey('MediaPause');