Skip to content

Commit

Permalink
fix encryption crap
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Feb 19, 2013
1 parent da4e6af commit bba32d1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions examples/holla.js
Original file line number Diff line number Diff line change
Expand Up @@ -3546,6 +3546,7 @@ require.register("holla/dist/Call.js", function(exports, require, module){
return _this.pc.addIceCandidate(new RTC.IceCandidate(candidate));
});
this.parent.on("sdp." + this.user, function(stuff) {
console.log(stuff);
_this.pc.setRemoteDescription(new RTC.SessionDescription(stuff));
return _this.emit("sdp");
});
Expand Down Expand Up @@ -3659,6 +3660,7 @@ require.register("holla/dist/Call.js", function(exports, require, module){
var done, err,
_this = this;
done = function(desc) {
desc.sdp = RTC.processSDP(desc.sdp);
_this.pc.setLocalDescription(desc);
return _this.socket.write({
type: "sdp",
Expand All @@ -3667,7 +3669,7 @@ require.register("holla/dist/Call.js", function(exports, require, module){
});
};
err = function(e) {
return console.log(e);
throw e;
};
if (this.isCaller) {
return this.pc.createOffer(done, err);
Expand Down Expand Up @@ -3731,7 +3733,7 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
line = _ref[_i];
out.push(line);
if ((__indexOf.call(search, 'm=') >= 0) !== -1) {
if ((__indexOf.call(line, 'm=') >= 0)) {
out.push(addCrypto);
}
}
Expand Down
6 changes: 4 additions & 2 deletions holla.js
Original file line number Diff line number Diff line change
Expand Up @@ -3546,6 +3546,7 @@ require.register("holla/dist/Call.js", function(exports, require, module){
return _this.pc.addIceCandidate(new RTC.IceCandidate(candidate));
});
this.parent.on("sdp." + this.user, function(stuff) {
console.log(stuff);
_this.pc.setRemoteDescription(new RTC.SessionDescription(stuff));
return _this.emit("sdp");
});
Expand Down Expand Up @@ -3659,6 +3660,7 @@ require.register("holla/dist/Call.js", function(exports, require, module){
var done, err,
_this = this;
done = function(desc) {
desc.sdp = RTC.processSDP(desc.sdp);
_this.pc.setLocalDescription(desc);
return _this.socket.write({
type: "sdp",
Expand All @@ -3667,7 +3669,7 @@ require.register("holla/dist/Call.js", function(exports, require, module){
});
};
err = function(e) {
return console.log(e);
throw e;
};
if (this.isCaller) {
return this.pc.createOffer(done, err);
Expand Down Expand Up @@ -3731,7 +3733,7 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
line = _ref[_i];
out.push(line);
if ((__indexOf.call(search, 'm=') >= 0) !== -1) {
if ((__indexOf.call(line, 'm=') >= 0)) {
out.push(addCrypto);
}
}
Expand Down
2 changes: 1 addition & 1 deletion holla.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/Call.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Call extends EventEmitter
@pc.addIceCandidate new RTC.IceCandidate candidate

@parent.on "sdp.#{@user}", (stuff) =>
console.log stuff
@pc.setRemoteDescription new RTC.SessionDescription stuff
@emit "sdp"

Expand Down Expand Up @@ -110,7 +111,7 @@ class Call extends EventEmitter

initSDP: ->
done = (desc) =>
#desc.sdp = RTC.processSDP desc.sdp
desc.sdp = RTC.processSDP desc.sdp
@pc.setLocalDescription desc
@socket.write
type: "sdp"
Expand Down
2 changes: 1 addition & 1 deletion lib/RTC.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ processSDP = (sdp) ->
out = []
for line in sdp.split '\r\n'
out.push line
out.push addCrypto if ('m=' in search) isnt -1
out.push addCrypto if ('m=' in line)
return out.join '\r\n'

attachStream = (uri, el) ->
Expand Down

0 comments on commit bba32d1

Please sign in to comment.