feat(audio) [closes #180] Mute own screen stream (#200)

* refactor: remove redundant function calls

* feat(video): [closes #180] mute self screen stream audio
This commit is contained in:
Jeremy Kahn 2023-11-04 00:54:59 -05:00 committed by GitHub
parent c0b76ff3e1
commit 3a97ee2cbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import { VideoStreamType } from 'models/chat'
import { SelectedPeerStream } from './RoomVideoDisplay'
interface PeerVideoProps {
isSelfScreenStream?: boolean
isSelfVideo?: boolean
numberOfVideos: number
onVideoClick?: (
@ -29,6 +30,7 @@ const nextPerfectSquare = (base: number) => {
}
export const PeerVideo = ({
isSelfScreenStream,
isSelfVideo,
numberOfVideos,
onVideoClick,
@ -87,6 +89,7 @@ export const PeerVideo = ({
>
<video
playsInline
muted={isSelfScreenStream}
ref={videoRef}
onClick={handleVideoClick}
style={{

View File

@ -173,6 +173,7 @@ export const RoomVideoDisplay = ({
)}
{selfScreenStream && (
<PeerVideo
isSelfScreenStream
numberOfVideos={numberOfVideos}
onVideoClick={handleVideoClick}
userId={userId}

View File

@ -66,8 +66,6 @@ export function useRoomVideo({ peerRoom }: UseRoomVideoConfig) {
type: VideoStreamType.WEBCAM,
})
setSelfVideoStream(newSelfStream)
setSelfVideoStream(newSelfStream)
}
})()
}, [peerRoom, selfVideoStream, setSelfVideoStream])
@ -144,7 +142,6 @@ export function useRoomVideo({ peerRoom }: UseRoomVideoConfig) {
sendVideoChange(VideoState.STOPPED)
setVideoState(VideoState.STOPPED)
setSelfVideoStream(null)
setSelfVideoStream(null)
}
}
})()