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'
|
import { SelectedPeerStream } from './RoomVideoDisplay'
|
||||||
|
|
||||||
interface PeerVideoProps {
|
interface PeerVideoProps {
|
||||||
|
isSelfScreenStream?: boolean
|
||||||
isSelfVideo?: boolean
|
isSelfVideo?: boolean
|
||||||
numberOfVideos: number
|
numberOfVideos: number
|
||||||
onVideoClick?: (
|
onVideoClick?: (
|
||||||
@ -29,6 +30,7 @@ const nextPerfectSquare = (base: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const PeerVideo = ({
|
export const PeerVideo = ({
|
||||||
|
isSelfScreenStream,
|
||||||
isSelfVideo,
|
isSelfVideo,
|
||||||
numberOfVideos,
|
numberOfVideos,
|
||||||
onVideoClick,
|
onVideoClick,
|
||||||
@ -87,6 +89,7 @@ export const PeerVideo = ({
|
|||||||
>
|
>
|
||||||
<video
|
<video
|
||||||
playsInline
|
playsInline
|
||||||
|
muted={isSelfScreenStream}
|
||||||
ref={videoRef}
|
ref={videoRef}
|
||||||
onClick={handleVideoClick}
|
onClick={handleVideoClick}
|
||||||
style={{
|
style={{
|
||||||
|
@ -173,6 +173,7 @@ export const RoomVideoDisplay = ({
|
|||||||
)}
|
)}
|
||||||
{selfScreenStream && (
|
{selfScreenStream && (
|
||||||
<PeerVideo
|
<PeerVideo
|
||||||
|
isSelfScreenStream
|
||||||
numberOfVideos={numberOfVideos}
|
numberOfVideos={numberOfVideos}
|
||||||
onVideoClick={handleVideoClick}
|
onVideoClick={handleVideoClick}
|
||||||
userId={userId}
|
userId={userId}
|
||||||
|
@ -66,8 +66,6 @@ export function useRoomVideo({ peerRoom }: UseRoomVideoConfig) {
|
|||||||
type: VideoStreamType.WEBCAM,
|
type: VideoStreamType.WEBCAM,
|
||||||
})
|
})
|
||||||
setSelfVideoStream(newSelfStream)
|
setSelfVideoStream(newSelfStream)
|
||||||
|
|
||||||
setSelfVideoStream(newSelfStream)
|
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
}, [peerRoom, selfVideoStream, setSelfVideoStream])
|
}, [peerRoom, selfVideoStream, setSelfVideoStream])
|
||||||
@ -144,7 +142,6 @@ export function useRoomVideo({ peerRoom }: UseRoomVideoConfig) {
|
|||||||
sendVideoChange(VideoState.STOPPED)
|
sendVideoChange(VideoState.STOPPED)
|
||||||
setVideoState(VideoState.STOPPED)
|
setVideoState(VideoState.STOPPED)
|
||||||
setSelfVideoStream(null)
|
setSelfVideoStream(null)
|
||||||
setSelfVideoStream(null)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
Loading…
Reference in New Issue
Block a user