forked from Shiloh/remnantchat
* refactor: remove redundant function calls * feat(video): [closes #180] mute self screen stream audio
This commit is contained in:
parent
c0b76ff3e1
commit
3a97ee2cbf
@ -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={{
|
||||
|
@ -173,6 +173,7 @@ export const RoomVideoDisplay = ({
|
||||
)}
|
||||
{selfScreenStream && (
|
||||
<PeerVideo
|
||||
isSelfScreenStream
|
||||
numberOfVideos={numberOfVideos}
|
||||
onVideoClick={handleVideoClick}
|
||||
userId={userId}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
})()
|
||||
|
Loading…
Reference in New Issue
Block a user