@@ -15,7 +15,6 @@ const GameView: FC<GameViewProps> = ({ roomId }) => {
1515 const { remotePeers, localPeer } = usePeers < { name : string } > ( ) ;
1616 const trpcClient = useTRPCClient ( ) ;
1717 const agentAudioRef = useRef < HTMLAudioElement > ( null ) ;
18- console . log ( remotePeers ) ;
1918
2019 const { data : roomData } = useQuery ( {
2120 queryKey : [ 'room' , roomId ] ,
@@ -24,7 +23,7 @@ const GameView: FC<GameViewProps> = ({ roomId }) => {
2423 } ) ;
2524
2625 const agentPeerId = useMemo (
27- ( ) => roomData ?. peers ?. find ( ( peer : any ) => peer . type === 'agent' ) ?. id ,
26+ ( ) => roomData ?. peers ?. find ( ( peer ) => peer . type === 'agent' ) ?. id ,
2827 [ roomData ?. peers ] ,
2928 ) ;
3029
@@ -48,7 +47,7 @@ const GameView: FC<GameViewProps> = ({ roomId }) => {
4847 if ( ! agentAudioRef . current ) return ;
4948 const audioStream = agentPeer ?. tracks [ 0 ] ?. stream ;
5049 agentAudioRef . current . srcObject = audioStream ?? null ;
51- } , [ agentPeer ?. microphoneTrack ?. stream ] ) ;
50+ } , [ agentPeer ?. tracks [ 0 ] ?. stream ] ) ;
5251
5352 const gridColumns = displayedPeers . length + 1 ;
5453
@@ -60,7 +59,9 @@ const GameView: FC<GameViewProps> = ({ roomId }) => {
6059 </ section >
6160 < section
6261 className = "w-full h-1/2 grid place-items-center gap-4 py-10 px-10"
63- style = { { gridTemplateColumns : `repeat(${ gridColumns } , minmax(0, 1fr))` } }
62+ style = { {
63+ gridTemplateColumns : `repeat(${ gridColumns } , minmax(0, 1fr))` ,
64+ } }
6465 >
6566 < PeerTile
6667 className = "max-w-2xl"
@@ -75,11 +76,12 @@ const GameView: FC<GameViewProps> = ({ roomId }) => {
7576 stream = {
7677 peer . customVideoTracks [ 0 ] ?. stream ?? peer . cameraTrack ?. stream
7778 }
78- audioStream = { peer . microphoneTrack ?. stream }
79+ audioStream = { peer . microphoneTrack ?. stream }
7980 />
8081 ) ) }
8182 </ section >
82- < audio ref = { agentAudioRef } autoPlay playsInline title = { "Agent audio" } />
83+ { /* biome-ignore lint/a11y/useMediaCaption: Peer audio feed from WebRTC doesn't have captions */ }
84+ < audio ref = { agentAudioRef } autoPlay playsInline title = { 'Agent audio' } />
8385 </ >
8486 ) ;
8587} ;
0 commit comments