muaz-khan / RTCMultiConnection

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)
https://muazkhan.com:9001/
MIT License
2.57k stars 1.37k forks source link

connection.onstream isScreen isn't set as it should be #863

Open Lyliya opened 4 years ago

Lyliya commented 4 years ago

Hi,

I tried to open a screen share while already in a audio/video conference. I use this code to start the screen share :

connection.addStream({ screen: true, oneway: true });

When i get this on connection.onstream (https://www.rtcmulticonnection.org/docs/onstream/), i have strange behaviour :

Is there a way to know if its a screen share without this ?

anoopbaabte commented 4 years ago

Did you sort this out?

I was exactly in the same situation and I ended up editing the rtcMultiConnection.js to fix this issue.

The edit I made was

I added the following lines in the getUserMediaHandler

if (localMediaConstraints.isScreen) { stream.isScreen = true; } else{ stream.isScreen = false; }

now it seems like

githubAnswerMultiConnection

jeangalliani commented 4 years ago

Did you sort this out?

I was exactly in the same situation and I ended up editing the rtcMultiConnection.js to fix this issue.

The edit I made was

I added the following lines in the getUserMediaHandler

if (localMediaConstraints.isScreen) { stream.isScreen = true; } else{ stream.isScreen = false; }

now it seems like

githubAnswerMultiConnection

Obrigado, isto resolveu meu problema!