RTCMultiConnection icon indicating copy to clipboard operation
RTCMultiConnection copied to clipboard

how to change the video for screen capture?

Open matheuscamarques opened this issue 4 years ago • 1 comments
trafficstars

how to change the video for screen capture?

matheuscamarques avatar May 25 '21 19:05 matheuscamarques

Funcitonal code.

 async function startCapture() {
            if (activeStream % 2) {
                connection.addStream({
                    screen: true,
                    audio: true,
                    oneway: true,
                });
                console.log(activeStream);
                activeStream++;
            } else {
                connection.addStream({
                    audio: true,
                    video: true,
                    oneway: true,
                });
                console.log("Connection video", activeStream);
                activeStream++;
            }
        }
var stream1 = {}
connection.onstream = function (event) {
            if (stream1) {
                stream1.stop();
                stream1 = event.stream;
        }

     //connection code is here
    stream1 = event.stream;
}

matheuscamarques avatar May 28 '21 18:05 matheuscamarques