@polyv/utils 2.6.0-beta.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/browser.d.ts +15 -0
- package/cjs/browser.js +1 -0
- package/es/browser.d.ts +15 -0
- package/es/browser.js +1 -0
- package/package.json +1 -1
package/cjs/browser.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断当前浏览器是否运行在移动设备上(User-Agent 识别为主,特征判断为辅)。
|
|
3
|
+
* @returns 当前浏览器是否运行在移动设备上。
|
|
4
|
+
*/
|
|
5
|
+
export declare function isMobile(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* 判断当前浏览器是否为傲游浏览器。
|
|
8
|
+
* @returns 当前浏览器是否为傲游浏览器。
|
|
9
|
+
*/
|
|
10
|
+
export declare function isMaxthon(): any;
|
|
11
|
+
/**
|
|
12
|
+
* 判断当前浏览器是否支持通过 MSE 播放 H264 视频。
|
|
13
|
+
* @returns 当前浏览器是否支持通过 MSE 播放 H264 视频。
|
|
14
|
+
*/
|
|
15
|
+
export declare function supportMSEH264(): boolean;
|
package/cjs/browser.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function isMobile(){var o=navigator.userAgent;return!!(/mobile|android/i.test(o)||/\bMacintosh\b/.test(o)&&navigator.maxTouchPoints)||!/\b(Windows\sNT|Macintosh|x86(_(32|64))?|amd64|i[1-6]86)\b/.test(o)&&"onorientationchange"in window}function isMaxthon(){var o=navigator.userAgent;if(/\bMaxthon\b/i.test(o))return!0;if("maxthon"in window){var t=window.maxthon;return"function"==typeof t.IsMaxthon&&t.IsMaxthon()}return!1}function supportMSEH264(){var o=window.MediaSource;return o&&"function"==typeof o.isTypeSupported&&o.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}Object.defineProperty(exports,"__esModule",{value:!0}),exports.supportMSEH264=exports.isMaxthon=exports.isMobile=void 0,exports.isMobile=isMobile,exports.isMaxthon=isMaxthon,exports.supportMSEH264=supportMSEH264;
|
package/es/browser.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断当前浏览器是否运行在移动设备上(User-Agent 识别为主,特征判断为辅)。
|
|
3
|
+
* @returns 当前浏览器是否运行在移动设备上。
|
|
4
|
+
*/
|
|
5
|
+
export declare function isMobile(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* 判断当前浏览器是否为傲游浏览器。
|
|
8
|
+
* @returns 当前浏览器是否为傲游浏览器。
|
|
9
|
+
*/
|
|
10
|
+
export declare function isMaxthon(): any;
|
|
11
|
+
/**
|
|
12
|
+
* 判断当前浏览器是否支持通过 MSE 播放 H264 视频。
|
|
13
|
+
* @returns 当前浏览器是否支持通过 MSE 播放 H264 视频。
|
|
14
|
+
*/
|
|
15
|
+
export declare function supportMSEH264(): boolean;
|
package/es/browser.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isMobile(){const t=navigator.userAgent;return!!(/mobile|android/i.test(t)||/\bMacintosh\b/.test(t)&&navigator.maxTouchPoints)||!/\b(Windows\sNT|Macintosh|x86(_(32|64))?|amd64|i[1-6]86)\b/.test(t)&&"onorientationchange"in window}export function isMaxthon(){const t=navigator.userAgent;if(/\bMaxthon\b/i.test(t))return!0;if("maxthon"in window){const t=window.maxthon;return"function"==typeof t.IsMaxthon&&t.IsMaxthon()}return!1}export function supportMSEH264(){const t=window.MediaSource;return t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}
|