@polyv/utils
Version:
Utility functions of Polyv frontend development.
1 lines • 1.12 kB
JavaScript
;function isMobile(){var t=navigator.userAgent;return!/\(X11[;)]/i.test(t)&&!/\b(Windows\sNT|Macintosh)\b/.test(t)&&/mobile|tablet|android/i.test(t)}function hasMobileFeature(){var t=navigator.platform;return"onorientationchange"in window&&"number"==typeof window.orientation||(!!/^(iPhone|iPod|iPad)/.test(t)||"Win32"!==t&&!/^Linux\s*(x86|i686)/.test(t)&&("MacIntel"===t||"Macintosh"===t?navigator.maxTouchPoints>0:"function"==typeof matchMedia&&(matchMedia("(hover: none)").matches&&matchMedia("(pointer: coarse)").matches&&!matchMedia("(pointer: fine)").matches)))}function isMaxthon(){var t=navigator.userAgent;if(/\bMaxthon\b/i.test(t))return!0;if("maxthon"in window){var e=window.maxthon;return"function"==typeof e.IsMaxthon&&e.IsMaxthon()}return!1}function supportMSEH264(){var t=window.MediaSource;return t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMobile=isMobile,exports.hasMobileFeature=hasMobileFeature,exports.isMaxthon=isMaxthon,exports.supportMSEH264=supportMSEH264;