Skip to content

Comments

Respect user preference for reduced motion when autoplaying#1532

Merged
mihar-22 merged 1 commit intovidstack:mainfrom
jramke:autoplay-reduced-motion
Feb 16, 2025
Merged

Respect user preference for reduced motion when autoplaying#1532
mihar-22 merged 1 commit intovidstack:mainfrom
jramke:autoplay-reduced-motion

Conversation

@jramke
Copy link
Contributor

@jramke jramke commented Dec 12, 2024

Related:

closes #1479

Description:

I already opened an issue and now had time to dig into the code.
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.

As a dev we could handle this with a simple check as @ianmiller347 already mentioned in the issue for example. But i think it would be a good practice to implement this directly so it works out of the box.

If the user prefers reduced motion and its autoplaying we throw during the play and not attemptAutoplay method because the auto-play-failed event is triggered by the play-fail event. Maybe i overlooked something and this could be improved.

Ready?

Yes

Anything Else?

No

Review Process:

@jramke jramke changed the title fix: autoplay for reduced motion Respect user preference for reduced motion when autoplaying Dec 12, 2024
@mihar-22 mihar-22 merged commit 6e44e76 into vidstack:main Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autoplay doesn't respect prefers-reduced-motion setting

2 participants