Skip to content

Commit

Permalink
old updates!
Browse files Browse the repository at this point in the history
  • Loading branch information
Muaz Khan committed Nov 21, 2013
1 parent 2f601aa commit fba5be4
Show file tree
Hide file tree
Showing 47 changed files with 11,367 additions and 2,163 deletions.
17 changes: 11 additions & 6 deletions DataChannel/DataChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,12 @@
OfferToReceiveVideo: !!moz
}
};

function onSdpError(e) {
console.error('sdp error:', e.name, e.message);
}

function onSdpSuccess() {}

function createOffer() {
if (!options.onOfferSDP) return;
Expand All @@ -944,20 +950,20 @@
sessionDescription.sdp = setBandwidth(sessionDescription.sdp);
peerConnection.setLocalDescription(sessionDescription);
options.onOfferSDP(sessionDescription);
}, null, constraints);
}, onSdpError, constraints);
}

function createAnswer() {
if (!options.onAnswerSDP) return;

options.offerSDP = new SessionDescription(options.offerSDP);
peerConnection.setRemoteDescription(options.offerSDP);
peerConnection.setRemoteDescription(options.offerSDP, onSdpSuccess, onSdpError);

peerConnection.createAnswer(function(sessionDescription) {
sessionDescription.sdp = setBandwidth(sessionDescription.sdp);
peerConnection.setLocalDescription(sessionDescription);
options.onAnswerSDP(sessionDescription);
}, null, constraints);
}, onSdpError, constraints);
}

function setBandwidth(sdp) {
Expand Down Expand Up @@ -1032,13 +1038,12 @@
}
}

function useless() {
}
function useless() {}

return {
addAnswerSDP: function(sdp) {
sdp = new SessionDescription(sdp);
peerConnection.setRemoteDescription(sdp);
peerConnection.setRemoteDescription(sdp, onSdpSuccess, onSdpError);
},
addICE: function(candidate) {
peerConnection.addIceCandidate(new IceCandidate({
Expand Down
Loading

0 comments on commit fba5be4

Please sign in to comment.