Updated demos to use the sucess and failure callback in addIceCandidate api.

R=dutton@google.com

Review URL: https://webrtc-codereview.appspot.com/7969004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5497 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
vikasmarwaha@webrtc.org
2014-02-06 22:38:37 +00:00
parent 60de116687
commit b307e86076
12 changed files with 141 additions and 23 deletions

View File

@@ -86,13 +86,15 @@ function connect() {
pc1.onicecandidate = function(e) {
log('Candidate PC1');
if (e.candidate) {
pc2.addIceCandidate(new RTCIceCandidate(e.candidate));
pc2.addIceCandidate(new RTCIceCandidate(e.candidate),
onAddIceCandidateSuccess, onAddIceCandidateError);
}
}
pc2.onicecandidate = function(e) {
log('Candidate PC2');
if (e.candidate) {
pc1.addIceCandidate(new RTCIceCandidate(e.candidate));
pc1.addIceCandidate(new RTCIceCandidate(e.candidate),
onAddIceCandidateSuccess, onAddIceCandidateError);
}
}
pc2.onaddstream = function(e) {
@@ -112,6 +114,14 @@ function connect() {
});
}
function onAddIceCandidateSuccess() {
trace("AddIceCandidate success.");
}
function onAddIceCandidateError(error) {
trace("Failed to add Ice Candidate: " + error.toString());
}
// Augumentation of stats entries with utility functions.
// The augumented entry does what the stats entry does, but adds
// utility functions.