I am using adapter.js in my webrtc 1-1 video call application. It works fine on Google Chrome and both peers see each other's video and can hear audio. However, when I run the same application on FireFox, I get the following error on console which comes from adapter.js.
NS_ERROR_UNEXPECTED
This is the function from adapter.js which gives the above error on return statement:
var RTCPeerConnection = function(pcConfig, pcConstraints) {
// .urls is not supported in FF yet.
maybeFixConfiguration(pcConfig);
return new mozRTCPeerConnection(pcConfig, pcConstraints);
};
This is what is inside pcConfig:
{"iceServers":[{"url":"stun:stun.l.google.com:19302"}]}
This is what is inside pcConstraints:
{"optional":[{"DtlsSrtpKeyAgreement":true},{"RtpDataChannels":true}],"mandatory":{}}
This is how the function maybeFixConfiguration(pcConfig)
looks like:
function maybeFixConfiguration(pcConfig) {
if (pcConfig == null) {
return;
}
for (var i = 0; i < pcConfig.iceServers.length; i++) {
if (pcConfig.iceServers[i].hasOwnProperty('urls')){
pcConfig.iceServers[i]['url'] = pcConfig.iceServers[i]['urls'];
delete pcConfig.iceServers[i]['urls'];
}
}
}
I don't understand what mistake I am doing here. Is something wrong with pcConfig and pcConstraints structure. I am using the latest FireFox I downloaded today.