Skip to content

Commit

Permalink
fixing reduce motion
Browse files Browse the repository at this point in the history
  • Loading branch information
hadasze committed Dec 9, 2024
1 parent b2365ee commit df189ae
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,23 @@ class VideoItemWrapper extends React.Component {
mightPlayVideo() {
const { videoPlay, itemClick } = this.props.options;
const { hasLink } = this.props;
const prefersReducedMotion =
window.matchMedia &&
window.matchMedia('(prefers-reduced-motion: reduce)').matches;

if (this.props.isVideoPlaceholder) {
return false;
}
if (prefersReducedMotion && videoPlay === 'auto') {
return false;
}
if (videoPlay === 'hover' || videoPlay === 'auto') {
return true;
} else if (itemClick === 'nothing') {
return true;
} else if (itemClick === 'link' && !hasLink) {
return true;
}
// }
return false;
}

Expand Down

0 comments on commit df189ae

Please sign in to comment.