mirror of
https://github.com/ggerganov/wave-share.git
synced 2026-03-24 08:31:04 +08:00
Fix the getIPs() function
Noticed it stopped working on Chrome. Was using a stun server (due to copy paste from the reference link) when one was not actually needed to create the RTCPeerConnection
This commit is contained in:
11
main.js
11
main.js
@@ -112,15 +112,8 @@ function getIPs(callback){
|
||||
useWebKit = !!win.webkitRTCPeerConnection;
|
||||
}
|
||||
|
||||
//minimal requirements for data connection
|
||||
var mediaConstraints = {
|
||||
optional: [{RtpDataChannels: true}]
|
||||
};
|
||||
|
||||
var servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};
|
||||
|
||||
//construct a new RTCPeerConnection
|
||||
var pc = new RTCPeerConnection(servers, mediaConstraints);
|
||||
var pc = new RTCPeerConnection(null);
|
||||
|
||||
function handleCandidate(candidate){
|
||||
//match just the IP address
|
||||
@@ -289,7 +282,7 @@ function senderInit() {
|
||||
senderPC = new RTCPeerConnection(null);
|
||||
|
||||
senderPC.oniceconnectionstatechange = function(e) {
|
||||
var state = senderPC.iceConnectionState;
|
||||
//var state = senderPC.iceConnectionState;
|
||||
};
|
||||
|
||||
senderPC.onicecandidate = function(e) {
|
||||
|
||||
Reference in New Issue
Block a user