Chrome 50 AdapterJS issue

39 views
Skip to first unread message

soen.t...@ionoco.com

unread,
May 25, 2016, 6:36:42 AM5/25/16
to Temasys WebRTC Plugin
Hi!
I'm developing a WebRTC project, which I am upgrading to use Temasys's plugin to get it to work with IE11.

I've noticed that there's an incompatibility between Temasys's AdapterJS file and Chrome 50:

For IE, to create an answer I call the (fairly standard) createAnswer with callbacks

pc.createAnswer(function(sdp){
   setLocalAndSendMessage(sdp, false);
}, null, sdpConstraints);

However, in Chrome 50, createAnswer with callbacks is deprecated and so no longer works in this fashion. Instead, it must use the promise-style call.

pc.createAnswer(sdpConstraints).then(function(answer) {
return setLocalAndSendMessage(answer, false);
}).catch(handleUserMediaError);

Attempting to call createAnswer with callbacks raises an error within AdapterJS:

adapter.min.js:908 Uncaught TypeError: Failed to execute 'createAnswer' on 'RTCPeerConnection': The callback provided as parameter 2 is not a function.

I'm just wondering if:
A) I'm doing something wrong
B) If anyone else has experienced this
C) If Temasys is aware/is going to patch this?

In the meantime, I'm going to add my own workaround, but I just wanted to feed this back to the community.

Thanks, and keep up the good work!
Soen

Jacques-Olivier Haché

unread,
May 26, 2016, 4:04:49 AM5/26/16
to Temasys WebRTC Plugin
Hi,

The second argument of createAnswer is not nullable.
If you have nothing to do, just provide an empty function :
pc.createAnswer(function(sdp){
                setLocalAndSendMessage(sdp, false);
                }, function() {}, sdpConstraints);

The plugin is a little bit more permissive than Chrome on this, but the spec (the ones that were still callback based) are pretty clear about it :

I hope this help,
J-O
Reply all
Reply to author
Forward
0 new messages