Accessing RTCPeerConnection Object

301 views
Skip to first unread message

Bimalkant Lauhny

unread,
Jun 3, 2017, 12:33:07 AM6/3/17
to meetecho-janus
Hi Lorenzo,

I'm working on a project related to generating the WebRTC stats for an application using Janus-gateway.
I'm stuck at a point where I require access to RTCPeerConnection Object.

I wanted to ask if it is possible to get the Object from janus.js?? I went through the API but I couldn't see any relevant method..

Please help me out on this.

One more thing. In janus debug output, I could see that for n clients in a room, each client has n RTCPeerConnection Objects. Shouldn't the number be n-1.
Or, why one more RTCPeerConnection Object???

Thanks in advance.

Mirko Brankovic

unread,
Jun 3, 2017, 1:33:13 AM6/3/17
to meetecho-janus
PeerConnection is created per stream, so x participants and +1 for your uploading one.

I don't know about js methods for returning pc, but i guess if you console.log(pc) at any point in code you will get the pc object, since that one is created by browser based on janus.js constraints.

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ju Ju

unread,
Jun 3, 2017, 4:57:25 AM6/3/17
to meetecho-janus
PeerConnection is created per stream, so x participants and +1 for your uploading one.

it is not rather n-1 participant per participant for receive stream +n for one who send a stream
So for n to n conf where everybody is sending something, to my pov the number of peerco is :

(n-1)*n + n

From my understanding, if each participant want to display their own feed they will use the same peerco they use for sending their stream. So the formula above is still true.

JG

Lorenzo Miniero

unread,
Jun 3, 2017, 5:08:38 AM6/3/17
to meetecho-janus
You can access the PeerConnection object in janus.js via the handle you created, accessing the webcrtStuff property which then contains a variable called pc. So for instance, in the echotest demo, the handle object is called echotest, so echotest.webrtcStuff.pc will give you the PeerConnection object.

L.

Bimalkant Lauhny

unread,
Jun 3, 2017, 8:30:06 AM6/3/17
to meetecho-janus
 Thanks a ton for this Lorenzo... Now I can access the RTCPeerConnection object easily..

Angus Margerison

unread,
Feb 15, 2023, 12:39:27 PM2/15/23
to meetecho-janus
Hello All

I am trying to connect to webstats and i need to find the pc. I have tried streaming.webrtcStuff.pc and it is giving me a null . Am i doing something wrong?

AI would appreciate any advice.

Thank you

Angus
Reply all
Reply to author
Forward
0 new messages