- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
stream.channel.peerConnection
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
- Tags:
- HTML5
- JavaScript*
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
well, I just found the repository for owt.j at https://github.com/open-webrtc-toolkit/owt-client-javascript
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)
changing
const channel = createPeerConnectionChannel(); return channel.publish(stream, options);
to:
var channel = createPeerConnectionChannel(); stream.channel = channel; return channel.publish(stream, options);
then I can reach the RTCPeerConnection of my stream using:
stream.channel._pc
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've created an issue on Github. You may track its progress at https://github.com/open-webrtc-toolkit/owt-client-javascript/issues/312.
![](/skins/images/C4F7392A5C68ACA60290C9576F107044/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page