-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] 설정 다이얼로그를 통한 마이크/카메라 선택 기능 구현 #338
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seoko97
requested review from
begong313,
simeunseo,
Jieun1ee and
Fixtar
as code owners
December 1, 2024 20:34
🎨 스토리북 확인하기
|
simeunseo
approved these changes
Dec 2, 2024
Comment on lines
+44
to
+55
{videoDevices.length !== 0 && ( | ||
<select | ||
value={selectedVideoDeviceId ?? '선택'} | ||
onChange={(e) => setSelectedVideoDeviceId(e.target.value)} | ||
className="mt-2 w-full" | ||
> | ||
{videoDevices.map((device) => ( | ||
<option key={device.value} value={device.value}> | ||
{device.label} | ||
</option> | ||
))} | ||
</select> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P4
기왕 하는거 Select 공통 컴포넌트를 사용하면 좋을거같긴합니다~! 우선순위는 매우 낮으니 이 부분은 제가 수정할게요!!
Comment on lines
+160
to
+189
useEffect(() => { | ||
if (!selectedVideoDeviceId) return; | ||
|
||
const videoTrack = video.stream?.getVideoTracks()[0]; | ||
|
||
if (!videoTrack) return; | ||
|
||
const isSameDevice = videoTrack.getSettings().deviceId === selectedVideoDeviceId; | ||
|
||
if (isSameDevice) return; | ||
|
||
closeStream('video'); | ||
startCameraStream(); | ||
}, [selectedVideoDeviceId]); | ||
|
||
useEffect(() => { | ||
if (!selectedAudioDeviceId) return; | ||
|
||
const audioTrack = audio.stream?.getAudioTracks()[0]; | ||
|
||
if (!audioTrack) return; | ||
|
||
const isSameDevice = audioTrack.getSettings().deviceId === selectedAudioDeviceId; | ||
|
||
if (isSameDevice) return; | ||
|
||
closeStream('audio'); | ||
startMicStream(); | ||
}, [selectedAudioDeviceId]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기가 핵심 로직이로군요 확인했습니다!
begong313
approved these changes
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Warning
이전 #334가 아직 병합되지 않아 이전 커밋 내역이 남아있습니다.
해당 PR을 먼저 리부해주시면 감사하겠습니다.
관련 이슈 번호
작업 내용
고민과 학습내용
기존
useLocalStream
내부에서 작성중이던 MediaStream관련 로직을useMediaTracks
내부에서 관리하도록 변경하였습니다.변경 이유는 다음과 같습니다.
useLocalStream
에 경우 mediasoup 관련 로직이 함께 존재useMediaTracks
을 통해 미디어 트랙 정보 및 스트림 정보를 관리하고자 분리 진행스크린샷