diff options
author | Sam Potts <me@sampotts.me> | 2017-05-22 09:07:14 +1000 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2017-05-22 09:07:14 +1000 |
commit | aaab9ad0829d2fff895316797826d23f294ac966 (patch) | |
tree | 8f4255069944b23aed1685c5af04fe7f8a818b2c /src/js | |
parent | 86c900418322353239a40fe2e061a3f2fbc786dc (diff) | |
download | plyr-aaab9ad0829d2fff895316797826d23f294ac966.tar.lz plyr-aaab9ad0829d2fff895316797826d23f294ac966.tar.xz plyr-aaab9ad0829d2fff895316797826d23f294ac966.zip |
Seperated reduce motion check
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/plyr.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index df910664..2a44a13b 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1188,9 +1188,12 @@ // Remember a device can be moust + touch enabled touch: 'ontouchstart' in document.documentElement, - // Detect transitions and if user has iOS & MacOS "Reduced motion" setting off + // Detect transitions support + transitions: utils.transitionEnd !== false, + + // Reduced motion iOS & MacOS setting // https://webkit.org/blog/7551/responsive-design-for-motion/ - transitions: utils.transitionEnd !== false && (!('matchMedia' in window) || !window.matchMedia('(prefers-reduced-motion)').matches) + reducedMotion: 'matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches }; // Player instance @@ -3426,7 +3429,7 @@ }); // If we can do fancy animations, we'll animate the height/width - if (support.transitions) { + if (support.transitions && !support.reducedMotion) { // Set the current width as a base container.style.width = current.scrollWidth + 'px'; container.style.height = current.scrollHeight + 'px'; |