new RTCSessionDescription() is obsolete and whats the alternative?

305 views
Skip to first unread message

Vignesh Bhaskar

unread,
Sep 7, 2016, 3:00:16 AM9/7/16
to discuss-webrtc
Hello Guys,

I am stuck with my experiments to get started with WebRTC.

I managed to pass the SDP from caller to callee via websockets.  So in the callee's socket.onmessage when the message type equals "session_description", I have the following code to attach the caller's SDP to the current peerConnection object of the callee.

peerConnection.setRemoteDescription(new RTCSessionDescription(message.sdp),successCallBack,errorCallBack);

But Chrome gives and error  "Uncaught TypeError: RTCSessionDescription is not a constructor"
When i checked the webrtc docs, it says new RTCSessionDescription() constructor is deprecated.

What is the alternative solution here?

Thanks.

Christoffer Jansson

unread,
Sep 7, 2016, 7:32:28 AM9/7/16
to discuss-webrtc
Hi,

It should still be there, at least in Chrome and Firefox, what browser are you using? Are you calling on it in the correct scope (i.e. window)?

Re deprecation: which docs are you referring to? Do note that in general it can take time for things to be deprecated, usually it stays for a while but with a deprecation warning message before it's completely removed.

/Chris

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ddc6490f-5b98-40ff-bad2-8bae04736911%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
/Chris
Reply all
Reply to author
Forward
0 new messages