From 7ca7e3613013693d9125ae17938bbab099c1a4df Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 29 Aug 2023 17:03:56 +0800 Subject: [PATCH] style: add toast tip for not support full screen browser --- .../src/components/lib/ParticipantTile.tsx | 8 +++++++- .../web/plugins/com.msgbyte.livekit/src/translate.ts | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/lib/ParticipantTile.tsx b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/lib/ParticipantTile.tsx index 501138ef11a..14b71ec4132 100644 --- a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/lib/ParticipantTile.tsx +++ b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/lib/ParticipantTile.tsx @@ -36,7 +36,7 @@ import { useSize } from '../../utils/useResizeObserver'; import { Translate } from '../../translate'; import { useMemo } from 'react'; import { FullScreenBtn } from '../FullScreenBtn'; -import { useEvent } from '@capital/common'; +import { showToasts, useEvent } from '@capital/common'; /** @public */ export type ParticipantTileProps = React.HTMLAttributes & { @@ -183,6 +183,12 @@ export const ParticipantTile = ({ if (checkIsFullscreen()) { document.exitFullscreen(); } else { + if (!containerEl.current.requestFullscreen) { + console.log(Translate.notSupportDOMFullscreen); + showToasts(Translate.notSupportDOMFullscreen, 'info'); + return; + } + containerEl.current.requestFullscreen(); } } diff --git a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/translate.ts b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/translate.ts index 7556f290d1c..e3d26d797f4 100644 --- a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/translate.ts +++ b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/translate.ts @@ -61,4 +61,8 @@ export const Translate = { 'zh-CN': '这些人正在会中:', 'en-US': 'Here is people in meeting:', }), + notSupportDOMFullscreen: localTrans({ + 'zh-CN': '当前浏览器不支持视图全屏', + 'en-US': 'Current browser does not support DOM full screen', + }), };