You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pause/Play button repaints causes flaky control in Chrome when using a Youtube video #694
Describe the bug
When using a Youtube video a interval is set here. This causes the refreshControls method to run periodically, which in turn ignores the context parameter and thus refreshes all UI elements, including the pause/play button. The getIcon method removes the element and repaints it, which causes flaky control in Chrome (141.0.7390.108). In Ableplayer v4.6.0 this problem didn't exist, because this works with changing the class instead of deleting and rebuilding the svg (at least, that is what I suspect).
Version tested
Which version of AblePlayer are you reporting against?
Expected behavior
I expect the button to, more or less, instantly correspond to the Youtube player state and when pressing the button it always works (which is not the case currently)
Desktop (please complete the following information):
OS: MacOS 26.0 (25A354)
Browser Chrome (141.0.7390.108)
Smartphone (please complete the following information):
Not tested on smartphone
Additional context
I've quick fixed the problem by adding a button state (thisObj.activePlayPauseButtonState) to the refreshControls method:
Now a repaint will only happen when the last state was it's opposite. But I can imagine there are better ways to fix this (maybe using the Youtube player API?)
I've got a different solution for this, which I think is better, as it will impact all icons. I've modified getIcon so it checks whether the icon already exists and skips the repaint if it does.
Activity
joedolson commentedon Oct 24, 2025
The YouTube player API is...iffy. So that might help, but I'll experiment. Thanks for the bug report!
drumwhacker commentedon Dec 5, 2025
Thank for looking into this, we also ran into this play button issue with youtube in one of our projects specifically using 4.7.
joedolson commentedon Dec 27, 2025
I've got a different solution for this, which I think is better, as it will impact all icons. I've modified
getIconso it checks whether the icon already exists and skips the repaint if it does.Avoid repainting icons when unchanged
joedolson commentedon Dec 27, 2025
I'm closing this issue, as I believe it's resolved; if anybody does come in and find an issue with this solution, don't hesitate to let me know!