[bug] Animated images play even when animate-on-hover is enabled when Media Proxy is disabled #344
Labels
No labels
a11y
Bug
Bug fix
Critical Priority
Documentation
Feature
Feature request
Held for next release cycle
High Priority
Low Priority
Medium Priority
Minor change
Translation/Locale
WIP
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma-fe#344
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version
8afbe5e3bc
What were you trying to do?
I'd like to be able to only have images animate when the cursor is hovering over them. This was working in earlier versions of Akkoma-FE until #341 was merged.
What did you expect to happen?
Animated images aren't animated until the cursor is hovering over them.
What actually happened?
Animated images are animated without the cursor being over.
This appears to be due to the
detectAnimation
method returning early if mediaproxy is disabled on the instance:// harmless CORS errors without-- clean console with
if (!mediaProxyAvailable) {
// It's a bit aggressive to assume all images we can't find the mimetype of is animated, but necessary for
// people in need of reduced motion accessibility. As such, we'll consider those images animated if the user
// agent is set to prefer reduced motion. Otherwise, it'll just be used as an early exit.
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
// Only for no media-proxy for now, since we're capturing gif, webp, and apng (are there others?)
// Since the canvas and images are not pixel-perfect matching (due to scaling),
// It makes the images jiggle on hover, which is not ideal for accessibility, methinks
this.isAnimated = true
}
return
}
I'm currently not running media proxy on my instance.
Severity
I cannot use it as easily as I'd like
Have you searched for this issue?
Definitely doable, the only caveat methinks would be that we wouldn't be able to detect whether a png or a webp is animated or not, and they'd show the label on the top right. We'd aggressively just mark as animated any webp/gif (png would be overkill methinks) we encounter. That'd be fine by ye? (It's basically what it was doing before lol)
Yeah I think that would be fine.