RobotInterrogation icon indicating copy to clipboard operation
RobotInterrogation copied to clipboard

Move to webRTC

Open FTWinston opened this issue 4 years ago • 2 comments

Instead of having the whole game run through the .NET server, it would be much more scalable if it used webRTC to connect clients directly to each other.

This would be much more scalable, but would be a significant architectural change.

FTWinston avatar Mar 31 '20 08:03 FTWinston

I'd do this through PeerJS and hosting a custom PeerJS server. This would also need a TURN server.

FTWinston avatar Mar 31 '20 08:03 FTWinston

local stream microphone not working while share screen + system audio shared in HTML JS

Screenshot 2023-07-19 182435

Here is code HTML + JS ✅

 function startScreenShare() {
        if (screenSharing) {
            stopScreenSharing()
        }
        navigator.mediaDevices.getDisplayMedia(
            { video: { mediaSource: "screen" }, audio: true }
        ).then((stream) => {
            setScreenSharingStream(stream);
    
            screenStream = stream;
            let videoTrack = screenStream.getAudioTracks()[0];
            videoTrack.onended = () => {
                stopScreenSharing()
            }
            if (peer) {
                let sender = currentPeer.peerConnection.getSenders().find(function (s) {
                    return s.track.kind == videoTrack.kind;
                })
                sender.replaceTrack(videoTrack)
                screenSharing = true
            }
            console.log(screenStream)
        })
    }

We have tried to share screen audio. When sharing the screen, microphone and screen-sharing audio do not work together. Mic does not work when system audio is on. System audio does not working if end mic is on. please explain me what is the about issue.

priyankgandhi0 avatar Jul 20 '23 03:07 priyankgandhi0