muxinc / player.style

A fresh collection of media player themes for every use case!
https://player.style
5 stars 2 forks source link

themes small breakpoint view glitch / bug #39

Open luwes opened 2 months ago

luwes commented 2 months ago

if you select the framework svelte in the left hand sidebar, the theme YT will disappear and you can see the render of the small view for a split second of the Demuxed 2022 theme and then the large view.

similarly this happens to the YT theme when going back.

this is a media-chrome issue caused by the setTimeout in the resize observer.

heff commented 2 months ago

Hmmm... Is this is unique enough situation that we really just need to fix it for player.style? Like is there a way to kick the resize observers for each theme whenever the filters change?

luwes commented 2 months ago

it's impossible to my knowledge to fix it in player.style. I wanted to discuss this in MCOH because we haven't been able to resolve this completely in the past. the quick fix is to remove the setTimeout here https://github.com/muxinc/media-chrome/blob/main/src/js/media-container.js#L375 which will remove the glitch but it introduces a non-fatal ResizeObserver error in the console in some rare cases, when CPU is constrained like in a Codesandbox.