diff --git a/src/pages/MeetingRoom.tsx b/src/pages/MeetingRoom.tsx index 18aa844..89c5065 100644 --- a/src/pages/MeetingRoom.tsx +++ b/src/pages/MeetingRoom.tsx @@ -77,6 +77,28 @@ interface PeerData { presence_ref: string; } +// Detector nativo de suporte ao WebGL +function isWebGLAvailable() { + try { + const canvas = document.createElement('canvas'); + return !!( + window.WebGLRenderingContext && + (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')) + ); + } catch (e) { + return false; + } +} + +// Hook de verificação de suporte a WebGL no cliente +function useWebGLSupport() { + const [supported, setSupported] = useState(true); + useEffect(() => { + setSupported(isWebGLAvailable()); + }, []); + return supported; +} + // --- Configurações da Mesa de Reunião --- const CHAIRS = [ { id: '1', name: 'Assento 1', pos: [-1.2, 0.95, -1.45], rot: [0, 0, 0], lookAt: [0, 0.95, 0] }, @@ -930,6 +952,7 @@ function ThreeMeetingRoomScene({ currentActiveModel, presentationState, isFocusM // --- Componente Principal da Tela --- export default function MeetingRoom() { + const isWebGLSupported = useWebGLSupport(); const { roomId } = useParams<{ roomId?: string }>(); const navigate = useNavigate(); const models = useModelStore((s) => s.models); @@ -1352,12 +1375,22 @@ export default function MeetingRoom() { {/* Enquadramento centralizado perfeito (Camera apontando e fov adequado) */}
- - - - - - + {isWebGLSupported ? ( + + + + + + + ) : ( +
+ + WebGL Desativado + + Aceleração por hardware inativa. O avatar 3D não pôde ser pré-visualizado. + +
+ )} {/* Aviso se o avatar estiver em uso na sala */} {isAvatarInUse && ( @@ -1514,41 +1547,67 @@ export default function MeetingRoom() {
{/* 3D Canvas - Sala Clara */}
- - - - {/* Renderizar avatares de TODOS na sala - Ocultados se modo foco */} - {!isFocusMode && Object.keys(peers).map((chairKey) => { - const peer = peers[chairKey]; - const chairConf = CHAIRS.find((c) => c.id === peer.chairId); - if (!chairConf) return null; + {isWebGLSupported ? ( + + - const isLocalUser = peer.chairId === selectedChair; + {/* Renderizar avatares de TODOS na sala - Ocultados se modo foco */} + {!isFocusMode && Object.keys(peers).map((chairKey) => { + const peer = peers[chairKey]; + const chairConf = CHAIRS.find((c) => c.id === peer.chairId); + if (!chairConf) return null; + + const isLocalUser = peer.chairId === selectedChair; - return ( - 0.5)} - isLastChatSender={peer.username === lastChatSender} - scale={1.2} - /> - ); - })} + return ( + 0.5)} + isLastChatSender={peer.username === lastChatSender} + scale={1.2} + /> + ); + })} - - + + + ) : ( +
+
+
+
+ +
+
+

WebGL Requerido

+

+ Aceleração por hardware (WebGL) está desativada ou não é suportada por seu navegador/dispositivo atual. +

+
+
+ Como resolver no Chrome: +

1. Vá em chrome://settings/system

+

2. Ative "Usar aceleração de hardware quando disponível"

+

3. Reinicie o navegador e recarregue esta página.

+
+
+ * Nota: O chat lateral, lista de participantes e chamadas continuam funcionando normalmente. +
+
+
+ )} {/* Painel do Apresentador (Controles de Manipulação Sincronizados) */} {isPresenter && (