8000 Fix(Mwpw-173688): Non-MPC videos honour o.s level accessibility setting. by sharath-kannan · Pull Request #4497 · adobecom/milo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix(Mwpw-173688): Non-MPC videos honour o.s level accessibility setting. #4497

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

Open
wants to merge 5 commits into
base: stage
Choose a base branch
from

Conversation

sharath-kannan
Copy link
Contributor
@sharath-kannan sharath-kannan commented Jul 1, 2025

Copy link
Contributor
aem-code-sync bot commented Jul 1, 2025

@sharath-kannan sharath-kannan changed the title Fix(Mwpw-173688): Non-MPC videos honor o.s level accessibility setting. Fix(Mwpw-173688): Non-MPC videos honour o.s level accessibility setting. Jul 1, 2025
@spadmasa spadmasa self-assigned this Jul 2, 2025
@@ -18,6 +18,7 @@ let videoLabels = {
playIcon: 'Play icon',
hasFetched: false,
};
const isReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)') === true || window.matchMedia('(prefers-reduced-motion: reduce)').matches === true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the change in here 🤔
window.matchMedia() is always having an object as the return value, which makes window.matchMedia('(prefers-reduced-motion: reduce)') === true redundant.
Please point it out if I'm missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, My bad.
I thought that the matchmedia function might return a boolean value in older versions but i was wrong.
I noticed that this(window.matchMedia('(prefers-reduced-motion: reduce)') === true) always returns false and hence can be removed.
I have updated the code, feel free to review it again.
Thanks.

@@ -18,6 +18,7 @@ let videoLabels = {
playIcon: 'Play icon',
hasFetched: false,
};
const isReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Per me, this check could be reused across multiple blocks to guide their accessibility behaviour. Maybe it could be moved to libs/utils/utils.js and imported here

Copy link
Contributor
github-actions bot commented Jul 8, 2025

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

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.

4 participants
0