Hi there, I'm migrating from 3.5.2 to 4.2.1, and I'm getting some trouble to find a reference to the underlaying peer connection of stream.
In 3.5.2 I used to perform:
and that would give me an instance of the RTCPeerConnection of my local stream.
but I'm not sure how to get that reference on 4.2.1.
My final goal is to get a list of RTCRtpSender's from that RTCPeerConnection, so I can call sender.replaceTrack() on each of them, as I used to do in 3.5.2 for switching cameras without republishing streams.
if that's not possible, is there any non-minified version of owt.js I could get so I can modify and expose the RTCPeerConnection myself?
I don't mind having to hack the source code, as I really do need this feature for my product,
thanks in advance
I cloned the 4.2.x branch, edited the file src/sdk/client.js
and hacked the "publish" function of Owt.Conference.ConferenceClient (around line #405)
const channel = createPeerConnectionChannel(); return channel.publish(stream, options);
var channel = createPeerConnectionChannel(); stream.channel = channel; return channel.publish(stream, options);
then I can reach the RTCPeerConnection of my stream using:
just a one-line hack that works fine for my use-case, no error checking and no fancy stuff.
hope you expose it properly on new releases
RTCPeerConnection is not exposed at this moment, and it will not be available in the upcoming 4.3 release either. However, we're planing to expose more WebRTC objects to developers. Basically, a Publication is associated with an RTCSender, and a Subscription is associated with an RTPReceiver. A PeerConnection might be shared by multiple streams in the future. BTW, this is not the final design. It needs to be reviewed before implementation.