Skip to content

player: don't update progress when page is not focused#169

Merged
tamland merged 1 commit intotamland:masterfrom
sentriz:only-progress-background
Dec 4, 2025
Merged

player: don't update progress when page is not focused#169
tamland merged 1 commit intotamland:masterfrom
sentriz:only-progress-background

Conversation

@sentriz
Copy link
Copy Markdown
Contributor

@sentriz sentriz commented Dec 4, 2025

Fixes an issue where on Firefox, airsonic-refix uses ~50% CPU when playing a track. Even when not focused.

The issue lies somewhere in the progress bar being updated from ontimeupdate

Looking at a profile:

RefreshDriver tick (70%) -> Update the rendering paint (55%) -> Paint (54%)

Chrome seems not have the issue, maybe it's internally throttling when not focused.

For Firefox, just not updating the store when the document is hidden dropped usage down to 8% from 50% for me

image

Fixes an issue where on Firefox, airsonic-refix uses ~50% CPU when
playing a track. Even when not focused.

The issue lies somewhere in the progress bar being updated form ontimeupdate

Looking at a profile:

	RefreshDriver tick (70%) -> Update the rendering paint (55%) -> Paint (54%)

Chrome seems not have the issue, maybe it's internally throttling when
not focused.

For Firefox, just not updating the store when the document is hidden
dropped usage down to 8% from 50% for me.
@tamland tamland merged commit 5910e6f into tamland:master Dec 4, 2025
1 check passed
@tamland
Copy link
Copy Markdown
Owner

tamland commented Dec 4, 2025

Do you know if this is still an issue in the vue3 branch which uses vue-slider-component 4.1.0-beta.7? I have been looking for replacement for this component but not been able to find one

monowii added a commit to monowii/airsonic-refix that referenced this pull request Dec 12, 2025
vue-slider-component has a default transition animation duration
of 0.5s, which causes repaint each frame.

Previous fix (tamland#169) blocked store updates when the page was hidden,
which did not fully resolve the CPU usage issue (and broke lastfm
scrobbling)
@tamland
Copy link
Copy Markdown
Owner

tamland commented Dec 12, 2025

Reverted since this broke scrobble and play queue save

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