TheQwertiest / foo_spider_monkey_panel

foobar2000 component that allows to use JavaScript to create CUI/DUI panels
https://theqwertiest.github.io/foo_spider_monkey_panel/
MIT License
274 stars 21 forks source link

Animated WebP, WebM, APNG support #214

Closed fwn0 closed 1 year ago

fwn0 commented 1 year ago

Please add animated WebP, WebM, APNG support to be able to display "animated album covers" (like live wallpapers) - (morphing, lighting, blending, etc. effects).

Would be great, thanks !

TheQwertiest commented 1 year ago

Not possible due to the script-driven nature of SMP rendering.

For animations to work, the corresponding animated image needs to be repainted after each animation frame. In SMP all the drawing is handled by user script and backend has no idea what is actually rendered. Rendering process looks like this:

So, at best it will be only possible to retrieve some frame delay data from corresponding image in the script, and user will have to repaint each frame manually, but even then it will be almost impossible to make animation speed accurate.

Browsers employ a different method of rendering: there is HTML layout that describes all the elements that are present on the screen, so browser is aware of all elements. Thus rendering process works very differently: