Skip to content

Commit

Permalink
feat(audio) [closes #180] Mute own screen stream (#200)
Browse files Browse the repository at this point in the history
* refactor: remove redundant function calls

* feat(video): [closes #180] mute self screen stream audio
  • Loading branch information
jeremyckahn authored Nov 4, 2023
1 parent c0b76ff commit 3a97ee2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/Room/PeerVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { VideoStreamType } from 'models/chat'
import { SelectedPeerStream } from './RoomVideoDisplay'

interface PeerVideoProps {
isSelfScreenStream?: boolean
isSelfVideo?: boolean
numberOfVideos: number
onVideoClick?: (
Expand All @@ -29,6 +30,7 @@ const nextPerfectSquare = (base: number) => {
}

export const PeerVideo = ({
isSelfScreenStream,
isSelfVideo,
numberOfVideos,
onVideoClick,
Expand Down Expand Up @@ -87,6 +89,7 @@ export const PeerVideo = ({
>
<video
playsInline
muted={isSelfScreenStream}
ref={videoRef}
onClick={handleVideoClick}
style={{
Expand Down
1 change: 1 addition & 0 deletions src/components/Room/RoomVideoDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const RoomVideoDisplay = ({
)}
{selfScreenStream && (
<PeerVideo
isSelfScreenStream
numberOfVideos={numberOfVideos}
onVideoClick={handleVideoClick}
userId={userId}
Expand Down
3 changes: 0 additions & 3 deletions src/components/Room/useRoomVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ export function useRoomVideo({ peerRoom }: UseRoomVideoConfig) {
type: VideoStreamType.WEBCAM,
})
setSelfVideoStream(newSelfStream)

setSelfVideoStream(newSelfStream)
}
})()
}, [peerRoom, selfVideoStream, setSelfVideoStream])
Expand Down Expand Up @@ -144,7 +142,6 @@ export function useRoomVideo({ peerRoom }: UseRoomVideoConfig) {
sendVideoChange(VideoState.STOPPED)
setVideoState(VideoState.STOPPED)
setSelfVideoStream(null)
setSelfVideoStream(null)
}
}
})()
Expand Down

1 comment on commit 3a97ee2

@vercel
Copy link

@vercel vercel bot commented on 3a97ee2 Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

chitchatter – ./

chitchatter-git-main-jeremyckahn.vercel.app
chitchatter.vercel.app
chitchatter-jeremyckahn.vercel.app

Please sign in to comment.