Show the signaling state and ice connection state in AppRTC by hooking up the peerconnections .onsignalingstatechange and .oniceconnectionstatechange events.
Hopefully this will increase the quality of the "it does not work" reports from users by giving them more information about what is going on under the hood. R=juberti@google.com Review URL: https://webrtc-codereview.appspot.com/2174004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4718 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
319c98d663
commit
641340944b
@ -143,6 +143,8 @@ function createPeerConnection() {
|
|||||||
}
|
}
|
||||||
pc.onaddstream = onRemoteStreamAdded;
|
pc.onaddstream = onRemoteStreamAdded;
|
||||||
pc.onremovestream = onRemoteStreamRemoved;
|
pc.onremovestream = onRemoteStreamRemoved;
|
||||||
|
pc.onsignalingstatechange = onSignalingStateChanged;
|
||||||
|
pc.oniceconnectionstatechange = onIceConnectionStateChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeStart() {
|
function maybeStart() {
|
||||||
@ -340,6 +342,14 @@ function onRemoteStreamRemoved(event) {
|
|||||||
console.log('Remote stream removed.');
|
console.log('Remote stream removed.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSignalingStateChanged(event) {
|
||||||
|
updateInfoDiv();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onIceConnectionStateChanged(event) {
|
||||||
|
updateInfoDiv();
|
||||||
|
}
|
||||||
|
|
||||||
function onHangup() {
|
function onHangup() {
|
||||||
console.log('Hanging up.');
|
console.log('Hanging up.');
|
||||||
transitionToDone();
|
transitionToDone();
|
||||||
@ -428,6 +438,13 @@ function updateInfoDiv() {
|
|||||||
for (var type in gatheredIceCandidateTypes[endpoint])
|
for (var type in gatheredIceCandidateTypes[endpoint])
|
||||||
contents += " " + type + "\n";
|
contents += " " + type + "\n";
|
||||||
}
|
}
|
||||||
|
if (pc != null) {
|
||||||
|
contents += "Gathering: " + pc.iceGatheringState + "\n";
|
||||||
|
contents += "</pre>\n";
|
||||||
|
contents += "<pre>PC State:\n";
|
||||||
|
contents += "Signaling: " + pc.signalingState + "\n";
|
||||||
|
contents += "ICE: " + pc.iceConnectionState + "\n";
|
||||||
|
}
|
||||||
var div = getInfoDiv();
|
var div = getInfoDiv();
|
||||||
div.innerHTML = contents + "</pre>";
|
div.innerHTML = contents + "</pre>";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user