mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-08 00:29:19 +09:00
8b0fdfcd69
* wip * (fix) `/files` をバイトレンジリクエストに対応させる * video * audio * fix * fix * spdx * fix (rangeRequest) * fix * Update CHANGELOG.md * (add) ボリュームを保存できるように * (fix) ミュート復帰時に音量が固定される * named export * tweak design * Add sensitive class for audio component * Refactor seekbar styles * Refactor hms * Revert "(add) ボリュームを保存できるように" This reverts commit6271f9493b
. * Revert "(fix) ミュート復帰時に音量が固定される" This reverts commita65002b56e
. * revert revert changes --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
25 lines
981 B
TypeScript
25 lines
981 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { defaultStore } from '@/store.js';
|
|
|
|
await defaultStore.ready;
|
|
|
|
const ua = navigator.userAgent.toLowerCase();
|
|
const isTablet = /ipad/.test(ua) || (/mobile|iphone|android/.test(ua) && window.innerWidth > 700);
|
|
const isSmartphone = !isTablet && /mobile|iphone|android/.test(ua);
|
|
|
|
const isIPhone = /iphone|ipod/gi.test(ua) && navigator.maxTouchPoints > 1;
|
|
// navigator.platform may be deprecated but this check is still required
|
|
const isIPadOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;
|
|
const isIos = /ipad|iphone|ipod/gi.test(ua) && navigator.maxTouchPoints > 1;
|
|
|
|
export const isFullscreenNotSupported = isIPhone || isIos;
|
|
|
|
export const deviceKind: 'smartphone' | 'tablet' | 'desktop' = defaultStore.state.overridedDeviceKind ? defaultStore.state.overridedDeviceKind
|
|
: isSmartphone ? 'smartphone'
|
|
: isTablet ? 'tablet'
|
|
: 'desktop';
|