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

@@ -122,17 +122,27 @@ function gotRemoteStream(e) {
function iceCallback1(event) {
if (event.candidate) {
pc2.addIceCandidate(new RTCIceCandidate(event.candidate));
pc2.addIceCandidate(new RTCIceCandidate(event.candidate),
onAddIceCandidateSuccess, onAddIceCandidateError);
trace("Local ICE candidate: \n" + event.candidate.candidate);
}
}
function iceCallback2(event) {
if (event.candidate) {
pc1.addIceCandidate(new RTCIceCandidate(event.candidate));
pc1.addIceCandidate(new RTCIceCandidate(event.candidate),
onAddIceCandidateSuccess, onAddIceCandidateError);
trace("Remote ICE candidate: \n " + event.candidate.candidate);
}
}
function onAddIceCandidateSuccess() {
trace("AddIceCandidate success.");
}
function onAddIceCandidateError(error) {
trace("Failed to add Ice Candidate: " + error.toString());
}
</script>
</body>
</html>