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() { void startStream("upsideTowersDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > Запустить @@ -202,7 +204,7 @@ function App() {
МФК «Revolution towers»
Россия, Екатеринбург @@ -229,7 +231,7 @@ function App() { void startStream("nksJukovaDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -247,16 +249,16 @@ function App() { backgroundImage: `url("/images/cards/liferes.jpg")`, }} > - + - + - + ЖК «Life Резиденция» - + Россия, Тюмень @@ -265,7 +267,7 @@ function App() { void startStream("lifeResidence")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -283,16 +285,16 @@ function App() { backgroundImage: `url("/images/cards/aivaz.jpg")`, }} > - + - + - + ЖК «Айвазовский City» - + Россия, Тюмень @@ -301,7 +303,7 @@ function App() { void startStream("IvazowskyDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -320,19 +322,19 @@ function App() { backgroundImage: `url("/images/cards/shipyard.jpg")`, }} > - + - + - + IMI Saudi Shipyard - Saudi Arabia + Saudi Arabia void startStream("ShipyardSaudiDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -349,9 +351,9 @@ function App() { - + - + Запись на @@ -361,7 +363,7 @@ function App() { демонстрацию - + Запись на демонстрацию может быть @@ -372,9 +374,9 @@ function App() { setIsOpen(true)} - className="group relative px-6 py-2 bg-gradient rounded-full lg:text-base text-sm font-medium leading-normal w-fit" + className="relative px-6 py-2 text-sm font-medium leading-normal rounded-full group bg-gradient lg:text-base w-fit" > - + Записаться @@ -402,16 +404,16 @@ 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} {_muted ? : } {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 (
ЖК «Life Резиденция»
Россия, Тюмень @@ -265,7 +267,7 @@ function App() { void startStream("lifeResidence")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -283,16 +285,16 @@ function App() { backgroundImage: `url("/images/cards/aivaz.jpg")`, }} > - + - + - + ЖК «Айвазовский City» - + Россия, Тюмень @@ -301,7 +303,7 @@ function App() { void startStream("IvazowskyDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -320,19 +322,19 @@ function App() { backgroundImage: `url("/images/cards/shipyard.jpg")`, }} > - + - + - + IMI Saudi Shipyard - Saudi Arabia + Saudi Arabia void startStream("ShipyardSaudiDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -349,9 +351,9 @@ function App() { - + - + Запись на @@ -361,7 +363,7 @@ function App() { демонстрацию - + Запись на демонстрацию может быть @@ -372,9 +374,9 @@ function App() { setIsOpen(true)} - className="group relative px-6 py-2 bg-gradient rounded-full lg:text-base text-sm font-medium leading-normal w-fit" + className="relative px-6 py-2 text-sm font-medium leading-normal rounded-full group bg-gradient lg:text-base w-fit" > - + Записаться @@ -402,16 +404,16 @@ 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} {_muted ? : } {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 (
ЖК «Айвазовский City»
Россия, Тюмень @@ -301,7 +303,7 @@ function App() { void startStream("IvazowskyDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -320,19 +322,19 @@ function App() { backgroundImage: `url("/images/cards/shipyard.jpg")`, }} > - + - + - + IMI Saudi Shipyard - Saudi Arabia + Saudi Arabia void startStream("ShipyardSaudiDev")} - className="flex bg-gradient rounded-full p-2 gap-0 group-hover:gap-1 group-hover:pr-4 group-hover:pl-6 transition-all duration-300" + className="flex gap-0 p-2 transition-all duration-300 rounded-full bg-gradient group-hover:gap-1 group-hover:pr-4 group-hover:pl-6" > @@ -349,9 +351,9 @@ function App() { - + - + Запись на @@ -361,7 +363,7 @@ function App() { демонстрацию - + Запись на демонстрацию может быть @@ -372,9 +374,9 @@ function App() { setIsOpen(true)} - className="group relative px-6 py-2 bg-gradient rounded-full lg:text-base text-sm font-medium leading-normal w-fit" + className="relative px-6 py-2 text-sm font-medium leading-normal rounded-full group bg-gradient lg:text-base w-fit" > - + Записаться @@ -402,16 +404,16 @@ 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} {_muted ? : } {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 (
IMI Saudi Shipyard
Saudi Arabia
Запись на @@ -361,7 +363,7 @@ function App() { демонстрацию
Запись на демонстрацию может быть @@ -372,9 +374,9 @@ function App() {
Свяжитесь с нами
Хотите увеличить конверсию? @@ -428,13 +430,13 @@ 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" > - + - + - +
- + 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} {_muted ? : } {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 (
Загрузка 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() {
Пожалуйста, подождите...
{user?.name}