From 6c7289744c3a8d6917273744c2f50fc0a10eb969 Mon Sep 17 00:00:00 2001 From: inmake Date: Wed, 16 Oct 2024 17:59:42 +0500 Subject: [PATCH] upd --- src/App.tsx | 108 ++++++++++++++++++++------------------- src/ScheduledPage.tsx | 16 ++++++ src/components/Video.tsx | 14 ++--- src/pages/StreamPage.tsx | 5 ++ 4 files changed, 83 insertions(+), 60 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 7df5439..2b37b70 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -84,6 +84,8 @@ function App() { location = "a2"; } + console.log("location", location); + setLoading(true); try { @@ -145,11 +147,11 @@ function App() { />
-
+
-
+

Доступные @@ -167,23 +169,23 @@ function App() {

-
+
{/*
-
+
-
+
-

+

ЖК «Upside Towers»

-

+

Россия, Москва @@ -192,7 +194,7 @@ function App() {

*/} -
+
{i18n.language === "ru" ? ( <>
-
+
-
+
-

+

МФК «Revolution towers»

-

+

Россия, Екатеринбург @@ -229,7 +231,7 @@ function App() {

-
+
-
+

Запись на @@ -361,7 +363,7 @@ function App() { демонстрацию

-

+

Запись на демонстрацию может быть
@@ -372,9 +374,9 @@ function App() {

-
+
-
+

Свяжитесь
с нами

-

+

Хотите увеличить конверсию?
@@ -428,13 +430,13 @@ function App() {

-
+
-
+
-

+

Горячая линия

@@ -448,7 +450,7 @@ function App() { Написать - + Позвонить - +
-
-
+
+

Социальные @@ -476,21 +478,21 @@ function App() { target="_blank" className="group border border-[#3D425C] xl:p-4 p-3 rounded-full hover:border-[#52587A] transition-all" > - + - + - +

@@ -506,8 +508,8 @@ function App() {
-
-

+

+

-
+
info@graff.tech 8 800 770 00 67 @@ -542,7 +544,7 @@ function App() {
-
+
waseem@graff.tech +971 50 938 8902 @@ -565,11 +567,11 @@ function App() { ) : (
-

+

Загрузка diff --git a/src/ScheduledPage.tsx b/src/ScheduledPage.tsx index 1937467..1e06721 100644 --- a/src/ScheduledPage.tsx +++ b/src/ScheduledPage.tsx @@ -11,6 +11,7 @@ function ScheduledPage() { const { search } = useLocation(); const navigate = useNavigate(); const [countdownSeconds, setCountdownSeconds] = useState(); + const [showWait, setShowWait] = useState(); async function connect() { try { @@ -32,6 +33,15 @@ function ScheduledPage() { return; } + if (!result.activeSessionId) { + setShowWait(true); + + setTimeout(() => { + connect(); + }, 1000); + return; + } + navigate(`/stream/${result.activeSessionId}${search}`); } catch (error) { if (error instanceof Error) { @@ -57,6 +67,12 @@ function ScheduledPage() {

)} + + {showWait && ( +
+

Пожалуйста, подождите...

+
+ )}
); } diff --git a/src/components/Video.tsx b/src/components/Video.tsx index a0cfdfa..226f6e1 100644 --- a/src/components/Video.tsx +++ b/src/components/Video.tsx @@ -35,13 +35,13 @@ function Video({ mediaStream, muted, user }: Props) { remoteVideoRef.current.onplay = () => { setIsLoading(false); }; + + console.log("mediaStream", mediaStream?.getTracks()); }, [mediaStream]); useEffect(() => { - if (!remoteVideoRef.current) return; - - console.log("remoteVideoRef.current!.muted", remoteVideoRef.current.muted); - }, [remoteVideoRef.current?.muted]); + console.log("remoteVideoRef.current", remoteVideoRef); + }, [remoteVideoRef.current]); return (
@@ -54,18 +54,18 @@ function Video({ mediaStream, muted, user }: Props) { autoPlay muted={_muted} > -
+

{user?.name}

{isLoading && ( -
+
)} diff --git a/src/pages/StreamPage.tsx b/src/pages/StreamPage.tsx index dd1a699..f15513f 100644 --- a/src/pages/StreamPage.tsx +++ b/src/pages/StreamPage.tsx @@ -366,6 +366,11 @@ function StreamPage() { updateRemoteStreams(); }, [users.length]); + useEffect(() => { + toggleCamera(); + toggleMic(); + }, [localStream]); + return (