Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a visibility change event listener to reload the page #234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-soltys
Copy link

@m-soltys m-soltys commented Dec 9, 2023

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.

…s 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.
@dmitrylyzo
Copy link
Collaborator

I tested (without PR) on NU7400: the main page updates the state (progress) after a while (refresh timer?).
How long should the TV be turned off before the main page is going stale?
The app seems to unload after 1 minute.

Forcing an update on resuming is probably fine, but a hard reloading is too much, imo.

@m-soltys
Copy link
Author

The refresh occurs only when the app returns from the 'hidden' state. On my TV (QE75Q60R), this happens only when the TV is turned off with the app in the foreground and then turned back on. The refresh takes no more than a second. Bringing up other windows (settings, home screen) does not trigger this event, nor does it reload the main page.

Any idea what to use instead of hard reloading?

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented Dec 10, 2023

The refresh occurs only when the app returns from the 'hidden' state. On my TV (QE75Q60R), this happens only when the TV is turned off with the app in the foreground and then turned back on. The refresh takes no more than a second. Bringing up other windows (settings, home screen) does not trigger this event, nor does it reload the main page.

Refresh resets focus and scroll.
AFAIK, the video player page doesn't support refreshing.

Any idea what to use instead of hard reloading?

Not from the app, but there is a visibility handler in jellyfin-web.
It emits resume event. Maybe make emby-itemcontainer refresh on resume event?

But it will also refresh on window focus 😕 : https://github.com/jellyfin/jellyfin-web/blob/23b3fc44e629f2067097cd460f0fa925987fb353/src/components/apphost.js#L441-L442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants