Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Mar 6, 2013
1 parent c1bca65 commit ba28371
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 22 deletions.
17 changes: 11 additions & 6 deletions dist/Call.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/shims.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions examples/holla.js
Original file line number Diff line number Diff line change
Expand Up @@ -3547,13 +3547,18 @@ require.register("holla/dist/Call.js", function(exports, require, module){
return _this.pc.addIceCandidate(new shims.IceCandidate(candidate));
});
this.parent.on("sdp." + this.user, function(desc) {
var err, succ;
desc.sdp = shims.processSDPIn(desc.sdp);
_this.pc.setRemoteDescription(new shims.SessionDescription(desc));
console.log(desc);
if (!_this.isCaller) {
_this.initSDP();
}
return _this.emit("sdp");
err = function(e) {
throw e;
};
succ = function() {
if (!_this.isCaller) {
_this.initSDP();
}
return _this.emit("sdp");
};
return _this.pc.setRemoteDescription(new shims.SessionDescription(desc), succ, err);
});
this.parent.on("hangup." + this.user, function() {
return _this.emit("hangup");
Expand Down Expand Up @@ -3946,6 +3951,10 @@ require.register("holla/dist/shims.js", function(exports, require, module){
]
};
mediaConstraints = {
mandatory: {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true
},
optional: [
{
DtlsSrtpKeyAgreement: true
Expand Down
21 changes: 15 additions & 6 deletions holla.js
Original file line number Diff line number Diff line change
Expand Up @@ -3547,13 +3547,18 @@ require.register("holla/dist/Call.js", function(exports, require, module){
return _this.pc.addIceCandidate(new shims.IceCandidate(candidate));
});
this.parent.on("sdp." + this.user, function(desc) {
var err, succ;
desc.sdp = shims.processSDPIn(desc.sdp);
_this.pc.setRemoteDescription(new shims.SessionDescription(desc));
console.log(desc);
if (!_this.isCaller) {
_this.initSDP();
}
return _this.emit("sdp");
err = function(e) {
throw e;
};
succ = function() {
if (!_this.isCaller) {
_this.initSDP();
}
return _this.emit("sdp");
};
return _this.pc.setRemoteDescription(new shims.SessionDescription(desc), succ, err);
});
this.parent.on("hangup." + this.user, function() {
return _this.emit("hangup");
Expand Down Expand Up @@ -3946,6 +3951,10 @@ require.register("holla/dist/shims.js", function(exports, require, module){
]
};
mediaConstraints = {
mandatory: {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true
},
optional: [
{
DtlsSrtpKeyAgreement: true
Expand Down
2 changes: 1 addition & 1 deletion holla.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions lib/Call.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ class Call extends EventEmitter

@parent.on "sdp.#{@user}", (desc) =>
desc.sdp = shims.processSDPIn desc.sdp
@pc.setRemoteDescription new shims.SessionDescription(desc)
@initSDP() unless @isCaller
@emit "sdp"
err = (e) -> throw e
succ = =>
@initSDP() unless @isCaller
@emit "sdp"
@pc.setRemoteDescription new shims.SessionDescription(desc), succ, err

@parent.on "hangup.#{@user}", =>
@emit "hangup"
Expand Down
3 changes: 3 additions & 0 deletions lib/shims.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ shim = ->
url: "stun:stun.l.google.com:19302"
]
mediaConstraints =
mandatory:
OfferToReceiveAudio: true
OfferToReceiveVideo: true
optional: [
DtlsSrtpKeyAgreement: true
]
Expand Down

0 comments on commit ba28371

Please sign in to comment.