Skip to content

Commit

Permalink
full firefox support
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Feb 19, 2013
1 parent 3aac684 commit c035c7e
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 74 deletions.
28 changes: 9 additions & 19 deletions examples/holla.js
Original file line number Diff line number Diff line change
Expand Up @@ -3674,10 +3674,10 @@ require.register("holla/dist/Call.js", function(exports, require, module){
throw e;
};
if (this.isCaller) {
return this.pc.createOffer(done, err);
return this.pc.createOffer(done, err, RTC.constraints);
}
if (this.pc.remoteDescription) {
return this.pc.createAnswer(done, err);
return this.pc.createAnswer(done, err, RTC.constraints);
}
return this.once("sdp", function() {
return _this.pc.createAnswer(done, err);
Expand Down Expand Up @@ -3821,18 +3821,17 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
};

attachStream = function(uri, el) {
var e, srcAttr, _i, _len;
srcAttr = (browser === 'mozilla' ? 'mozSrcObject' : 'src');
var e, _i, _len;
if (typeof el === "string") {
return attachStream(uri, document.getElementById(el));
} else if (el.jquery) {
el.attr(srcAttr, uri);
el.attr('src', uri);
for (_i = 0, _len = el.length; _i < _len; _i++) {
e = el[_i];
e.play();
}
} else {
el[srcAttr] = uri;
el.src = uri;
el.play();
}
return el;
Expand All @@ -3856,12 +3855,7 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
OfferToReceiveAudio: true,
OfferToReceiveVideo: true,
MozDontOfferDataChannel: true
},
optional: [
{
DtlsSrtpKeyAgreement: true
}
]
}
};
MediaStream.prototype.getVideoTracks = function() {
return [];
Expand All @@ -3880,13 +3874,9 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
mediaConstraints = {
mandatory: {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true
},
optional: [
{
DtlsSrtpKeyAgreement: true
}
]
OfferToReceiveVideo: true,
DtlsSrtpKeyAgreement: true
}
};
if (!MediaStream.prototype.getVideoTracks) {
MediaStream.prototype.getVideoTracks = function() {
Expand Down
28 changes: 9 additions & 19 deletions holla.js
Original file line number Diff line number Diff line change
Expand Up @@ -3674,10 +3674,10 @@ require.register("holla/dist/Call.js", function(exports, require, module){
throw e;
};
if (this.isCaller) {
return this.pc.createOffer(done, err);
return this.pc.createOffer(done, err, RTC.constraints);
}
if (this.pc.remoteDescription) {
return this.pc.createAnswer(done, err);
return this.pc.createAnswer(done, err, RTC.constraints);
}
return this.once("sdp", function() {
return _this.pc.createAnswer(done, err);
Expand Down Expand Up @@ -3821,18 +3821,17 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
};

attachStream = function(uri, el) {
var e, srcAttr, _i, _len;
srcAttr = (browser === 'mozilla' ? 'mozSrcObject' : 'src');
var e, _i, _len;
if (typeof el === "string") {
return attachStream(uri, document.getElementById(el));
} else if (el.jquery) {
el.attr(srcAttr, uri);
el.attr('src', uri);
for (_i = 0, _len = el.length; _i < _len; _i++) {
e = el[_i];
e.play();
}
} else {
el[srcAttr] = uri;
el.src = uri;
el.play();
}
return el;
Expand All @@ -3856,12 +3855,7 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
OfferToReceiveAudio: true,
OfferToReceiveVideo: true,
MozDontOfferDataChannel: true
},
optional: [
{
DtlsSrtpKeyAgreement: true
}
]
}
};
MediaStream.prototype.getVideoTracks = function() {
return [];
Expand All @@ -3880,13 +3874,9 @@ require.register("holla/dist/RTC.js", function(exports, require, module){
mediaConstraints = {
mandatory: {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true
},
optional: [
{
DtlsSrtpKeyAgreement: true
}
]
OfferToReceiveVideo: true,
DtlsSrtpKeyAgreement: true
}
};
if (!MediaStream.prototype.getVideoTracks) {
MediaStream.prototype.getVideoTracks = function() {
Expand Down
2 changes: 1 addition & 1 deletion holla.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/Call.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ class Call extends EventEmitter

err = (e) -> throw e

return @pc.createOffer done, err if @isCaller
return @pc.createAnswer done, err if @pc.remoteDescription
return @pc.createOffer done, err, RTC.constraints if @isCaller
return @pc.createAnswer done, err, RTC.constraints if @pc.remoteDescription
@once "sdp", =>
@pc.createAnswer done, err

Expand Down
10 changes: 2 additions & 8 deletions lib/RTC.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ processSDPOut = (sdp) ->
processSDPIn = (sdp) -> return sdp

attachStream = (uri, el) ->
srcAttr = (if browser is 'mozilla' then 'mozSrcObject' else 'src')
if typeof el is "string"
return attachStream uri, document.getElementById el
else if el.jquery
el.attr srcAttr, uri
el.attr 'src', uri
e.play() for e in el
else
el[srcAttr] = uri
el.src = uri
el.play()
return el

Expand All @@ -93,9 +92,6 @@ shim = ->
OfferToReceiveAudio: true
OfferToReceiveVideo: true
MozDontOfferDataChannel: true
optional: [
DtlsSrtpKeyAgreement: true
]

MediaStream::getVideoTracks = -> []
MediaStream::getAudioTracks = -> []
Expand All @@ -108,9 +104,7 @@ shim = ->
mandatory:
OfferToReceiveAudio: true
OfferToReceiveVideo: true
optional: [
DtlsSrtpKeyAgreement: true
]
unless MediaStream::getVideoTracks
MediaStream::getVideoTracks = -> @videoTracks
MediaStream::getAudioTracks = -> @audioTracks
Expand Down
51 changes: 26 additions & 25 deletions lib/sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ a=ssrc:1989440299 label:ZiNUtAFWWumqt0tovX6AWjSj540TU2dTxoVTv0

```
v=0
o=Mozilla-SIPUA 13019 0 IN IP4 0.0.0.0
o=Mozilla-SIPUA 14503 0 IN IP4 0.0.0.0
s=SIP Call
t=0 0
a=ice-ufrag:08ea3118
a=ice-pwd:9461ee1123a4a0378624117018042460
a=fingerprint:sha-256 D2:3F:8A:AB:B5:A1:CE:DC:E5:64:95:BD:9B:C3:23:CF:5F:6D:BD:13:FA:24:61:58:2C:64:53:9A:10:26:D4:F5
m=audio 63274 RTP/SAVPF 109 0 8 101
a=ice-ufrag:43ae9738
a=ice-pwd:7cdfcc089d423c15c38aa763d8290bea
a=fingerprint:sha-256 A7:00:25:F0:68:0B:E6:B3:BC:12:CA:B7:F1:C3:1A:63:61:76:94:1B:F9:47:8F:CF:37:8B:09:D6:FB:BF:FB:55
m=audio 55243 RTP/SAVPF 109 0 8 101
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:BAADBAADBAADBAADBAADBAADBAADBAADBAADBAAD
c=IN IP4 38.104.206.46
a=rtpmap:109 opus/48000/2
Expand All @@ -69,32 +69,33 @@ a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=candidate:0 1 UDP 2113667327 192.168.23.176 64731 typ host
a=candidate:1 1 UDP 1694264319 38.104.206.46 63274 typ srflx raddr 192.168.23.176 rport 64731
a=candidate:2 1 UDP 2113339647 10.199.16.117 63268 typ host
a=candidate:0 2 UDP 2113667326 192.168.23.176 63625 typ host
a=candidate:1 2 UDP 1694264318 38.104.206.46 1088 typ srflx raddr 192.168.23.176 rport 63625
a=candidate:2 2 UDP 2113339646 10.199.16.117 60279 typ host
m=video 28074 RTP/SAVPF 120
a=candidate:0 1 UDP 2113667327 192.168.23.176 53712 typ host
a=candidate:1 1 UDP 1694285823 38.104.206.46 55243 typ srflx raddr 192.168.23.176 rport 53712
a=candidate:2 1 UDP 2113339647 10.199.16.117 51715 typ host
a=candidate:0 2 UDP 2113667326 192.168.23.176 63096 typ host
a=candidate:1 2 UDP 1694285822 38.104.206.46 26725 typ srflx raddr 192.168.23.176 rport 63096
a=candidate:2 2 UDP 2113339646 10.199.16.117 50542 typ host
m=video 18786 RTP/SAVPF 120
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:BAADBAADBAADBAADBAADBAADBAADBAADBAADBAAD
c=IN IP4 38.104.206.46
a=rtpmap:120 VP8/90000
a=sendrecv
a=candidate:0 1 UDP 2113667327 192.168.23.176 52585 typ host
a=candidate:1 1 UDP 1694264319 38.104.206.46 28074 typ srflx raddr 192.168.23.176 rport 52585
a=candidate:2 1 UDP 2113339647 10.199.16.117 60568 typ host
a=candidate:0 2 UDP 2113667326 192.168.23.176 52095 typ host
a=candidate:1 2 UDP 1694264318 38.104.206.46 10636 typ srflx raddr 192.168.23.176 rport 52095
a=candidate:2 2 UDP 2113339646 10.199.16.117 54253 typ host
m=application 3085 SCTP/DTLS 5000
a=candidate:0 1 UDP 2113667327 192.168.23.176 61376 typ host
a=candidate:1 1 UDP 1694285823 38.104.206.46 18786 typ srflx raddr 192.168.23.176 rport 61376
a=candidate:2 1 UDP 2113339647 10.199.16.117 62178 typ host
a=candidate:0 2 UDP 2113667326 192.168.23.176 59911 typ host
a=candidate:1 2 UDP 1694285822 38.104.206.46 14952 typ srflx raddr 192.168.23.176 rport 59911
a=candidate:2 2 UDP 2113339646 10.199.16.117 60944 typ host
m=application 12681 SCTP/DTLS 5000
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:BAADBAADBAADBAADBAADBAADBAADBAADBAADBAAD
c=IN IP4 38.104.206.46
a=fmtp:5000 protocol=webrtc-datachannel;streams=16
a=sendrecv
a=candidate:0 1 UDP 2113667327 192.168.23.176 63476 typ host
a=candidate:1 1 UDP 1694264319 38.104.206.46 3085 typ srflx raddr 192.168.23.176 rport 63476
a=candidate:2 1 UDP 2113339647 10.199.16.117 56979 typ host
a=candidate:0 2 UDP 2113667326 192.168.23.176 62303 typ host
a=candidate:1 2 UDP 1694264318 38.104.206.46 9813 typ srflx raddr 192.168.23.176 rport 62303
a=candidate:2 2 UDP 2113339646 10.199.16.117 54226 typ host
a=candidate:0 1 UDP 2113667327 192.168.23.176 50555 typ host
a=candidate:1 1 UDP 1694285823 38.104.206.46 12681 typ srflx raddr 192.168.23.176 rport 50555
a=candidate:2 1 UDP 2113339647 10.199.16.117 51909 typ host
a=candidate:0 2 UDP 2113667326 192.168.23.176 63541 typ host
a=candidate:1 2 UDP 1694285822 38.104.206.46 27602 typ srflx raddr 192.168.23.176 rport 63541
a=candidate:2 2 UDP 2113339646 10.199.16.117 55440 typ host
```

0 comments on commit c035c7e

Please sign in to comment.