Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoplay doesn't respect prefers-reduced-motion setting #1479

Open
jramke opened this issue Oct 22, 2024 · 1 comment · May be fixed by #1532
Open

Autoplay doesn't respect prefers-reduced-motion setting #1479

jramke opened this issue Oct 22, 2024 · 1 comment · May be fixed by #1532
Labels
bug Something isn't working

Comments

@jramke
Copy link

jramke commented Oct 22, 2024

Current Behavior:

The video player automatically starts playback when autoplay is set to true, even when the user has enabled reduced motion settings in their system preferences. This behavior may be problematic for users who rely on reduced motion settings for accessibility purposes.

Expected Behavior:

When a user has reduced motion settings enabled in their system preferences, the player should respect this setting and not autoplay videos, regardless of the autoplay attribute value. This aligns with accessibility best practices and user preferences for reduced motion.

Steps To Reproduce:

  1. Enable "Reduce Motion" in system settings or emulate via devtools
  2. Load the page with the video player

Note: the video must be muted for the browser to allow auoplay at all.

Reproduction Link: https://stackblitz.com/edit/vitejs-vite-8r9rcw?file=index.html

@jramke jramke added the bug Something isn't working label Oct 22, 2024
@ianmiller347
Copy link

you can use the following to change the value of autoplay attribute

const enableAutoplay = !window.matchMedia('(prefers-reduced-motion: reduce)').matches;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants