diff --git a/src/pages/Call.tsx b/src/pages/Call.tsx index b7633c1..de2453c 100644 --- a/src/pages/Call.tsx +++ b/src/pages/Call.tsx @@ -38,7 +38,7 @@ const Call = () => { const [contents, setContents] = useState([]); const { audio } = useContext(AudioContext); const { callInfo, dispatch } = useContext(CallContext); - const { disconnectStream } = useStream(); + const { stream, disconnectStream } = useStream(); const { socket } = useSocket(); const videos = [ useRef(null), @@ -420,7 +420,11 @@ const Call = () => { text={isMuted ? "mute off" : "mute"} img={isMuted ? "mute.svg" : "mute-off.svg"} > - + diff --git a/src/utils/MicrophoneSoundChecker.tsx b/src/utils/MicrophoneSoundChecker.tsx index 8df29d5..c6a804c 100644 --- a/src/utils/MicrophoneSoundChecker.tsx +++ b/src/utils/MicrophoneSoundChecker.tsx @@ -1,18 +1,18 @@ -import { useStream } from "@hooks/useStream"; import { useState, useEffect, FC, useRef } from "react"; interface Props { + stream: MediaStream; // useAudio가 필요없이 호출되는 것을 방지하기 위해 Props로 전환 icon?: boolean; isSmallSize?: boolean; bgColor?: string; } const MicrophoneSoundChecker: FC = ({ + stream, icon = false, isSmallSize = false, bgColor = "white", }) => { - const { stream } = useStream(); const [value, setValue] = useState(0); const divRef = useRef(null);