made STUN server the same for both chrome and firefox
This commit is contained in:
parent
248e41467b
commit
b61743a42c
1 changed files with 4 additions and 4 deletions
|
@ -24,7 +24,7 @@
|
||||||
|| window.mozRTCPeerConnection
|
|| window.mozRTCPeerConnection
|
||||||
|| window.webkitRTCPeerConnection;
|
|| window.webkitRTCPeerConnection;
|
||||||
var mediaConstraints = {
|
var mediaConstraints = {
|
||||||
optional: [{RtpDataChannels: true}, {DtlsSrtpKeyAgreement: false}]
|
optional: [{RtpDataChannels: true}]
|
||||||
};
|
};
|
||||||
|
|
||||||
//firefox already has a default stun server in about:config
|
//firefox already has a default stun server in about:config
|
||||||
|
@ -32,9 +32,9 @@
|
||||||
// [{"url": "stun:stun.services.mozilla.com"}]
|
// [{"url": "stun:stun.services.mozilla.com"}]
|
||||||
var servers = undefined;
|
var servers = undefined;
|
||||||
|
|
||||||
//add stun server for chrome
|
//add same stun server for chrome
|
||||||
if(window.webkitRTCPeerConnection)
|
if(window.webkitRTCPeerConnection)
|
||||||
servers = {iceServers: [{url: "stun:stun.l.google.com:19302"}]};
|
servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};
|
||||||
|
|
||||||
//construct a new RTCPeerConnection
|
//construct a new RTCPeerConnection
|
||||||
var pc = new RTCPeerConnection(servers, mediaConstraints);
|
var pc = new RTCPeerConnection(servers, mediaConstraints);
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
//create an offer sdp
|
//create an offer sdp
|
||||||
pc.createOffer(function(result){
|
pc.createOffer(function(result){
|
||||||
|
|
||||||
//trigger the
|
//trigger the stun server request
|
||||||
pc.setLocalDescription(result, function(){});
|
pc.setLocalDescription(result, function(){});
|
||||||
|
|
||||||
}, function(){});
|
}, function(){});
|
||||||
|
|
Loading…
Reference in a new issue