mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
add isIOS13
This commit is contained in:
1 parent
f6d6113423
commit
cf6670bc53
3 files changed
+5
-2
No files matched your search
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
- 使用 `switchUrl` 或者 `switchQuality` 方法切换地址后会保持原有的调整如:`aspectRatio`, `playbackRate`, `flip`, `autoSize`
|
- 使用 `switchUrl` 或者 `switchQuality` 方法切换地址后会保持原有的调整如:`aspectRatio`, `playbackRate`, `flip`, `autoSize`
|
||||||
- 删除 `switchUrl` 方法和 `switchQuality` 方法的第二个 `name` 参数
|
- 删除 `switchUrl` 方法和 `switchQuality` 方法的第二个 `name` 参数
|
||||||
|
- 添加 `isIOS13` 工具,用于修复在 `IOS13` 以上版本的设备上的 `isMobile` 判断不准确的问题
|
||||||
|
|
||||||
## [5.0.6] - 2023-5-3
|
## [5.0.6] - 2023-5-3
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
export const userAgent = typeof window !== 'undefined' ? window.navigator.userAgent : '';
|
export const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent : '';
|
||||||
export const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
|
|
||||||
export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
|
export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
|
||||||
export const isWechat = /MicroMessenger/i.test(userAgent);
|
export const isWechat = /MicroMessenger/i.test(userAgent);
|
||||||
export const isIE = /MSIE|Trident/i.test(userAgent);
|
export const isIE = /MSIE|Trident/i.test(userAgent);
|
||||||
export const isAndroid = /android/i.test(userAgent);
|
export const isAndroid = /android/i.test(userAgent);
|
||||||
export const isIOS = /iPad|iPhone|iPod/i.test(userAgent) && !window.MSStream;
|
export const isIOS = /iPad|iPhone|iPod/i.test(userAgent) && !window.MSStream;
|
||||||
|
export const isIOS13 = isIOS || (userAgent.includes('Macintosh') && navigator.maxTouchPoints >= 1);
|
||||||
|
export const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent) || isIOS13;
|
||||||
Vendored
+1
@@ -6,6 +6,7 @@ export type Utils = {
|
|||||||
isIE: boolean;
|
isIE: boolean;
|
||||||
isAndroid: boolean;
|
isAndroid: boolean;
|
||||||
isIOS: boolean;
|
isIOS: boolean;
|
||||||
|
isIOS13: boolean;
|
||||||
query(selector: string, parent?: HTMLElement): HTMLElement;
|
query(selector: string, parent?: HTMLElement): HTMLElement;
|
||||||
queryAll(selector: string, parent?: HTMLElement): HTMLElement[];
|
queryAll(selector: string, parent?: HTMLElement): HTMLElement[];
|
||||||
addClass(target: HTMLElement, className: string): void;
|
addClass(target: HTMLElement, className: string): void;
|
||||||
|
|||||||
Reference in new issue
Block a user