Try to detect iOS and *not* autoplay any videos

Technically the check for iOS from components is a side effect, because it's
neither in state nor props, but the user agent does not change, so I think
that's okay.
This commit is contained in:
Eugen Rochko 2017-03-07 09:54:57 +01:00
parent 1fb3e8988b
commit 47bf592db7
3 changed files with 10 additions and 2 deletions

View file

@ -3,3 +3,9 @@ const LAYOUT_BREAKPOINT = 1024;
export function isMobile(width) {
return width <= LAYOUT_BREAKPOINT;
};
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
export function isIOS() {
return iOS;
};