Implements workaround for the issues in firefox nightly.
This commit is contained in:
parent
2e26c212a2
commit
96824e60ab
|
@ -520,9 +520,24 @@ function setupRTC() {
|
|||
RTCIceCandidate = mozRTCIceCandidate;
|
||||
RTC.getLocalSSRC = function (session, callback) {
|
||||
session.peerconnection.getStats(function (s) {
|
||||
var keys = Object.keys(s);
|
||||
var audio = null;
|
||||
var video = null;
|
||||
for(var i = 0; i < keys.length; i++)
|
||||
{
|
||||
if(keys[i].indexOf("outbound_rtp_audio") != -1)
|
||||
{
|
||||
audio = s[keys[i]].ssrc;
|
||||
}
|
||||
|
||||
if(keys[i].indexOf("outbound_rtp_video") != -1)
|
||||
{
|
||||
video = s[keys[i]].ssrc;
|
||||
}
|
||||
}
|
||||
session.localStreamsSSRC = {
|
||||
"audio": s['outbound_rtp_audio_0'].ssrc,
|
||||
"video": s['outbound_rtp_video_1'].ssrc
|
||||
"audio": audio,//for stable 0
|
||||
"video": video// for stable 1
|
||||
};
|
||||
callback(session.localStreamsSSRC);
|
||||
},
|
||||
|
|
|
@ -296,11 +296,12 @@ JingleSession.prototype.sendIceCandidates = function (candidates) {
|
|||
sid: this.sid});
|
||||
for (var mid = 0; mid < this.localSDP.media.length; mid++) {
|
||||
var cands = candidates.filter(function (el) { return el.sdpMLineIndex == mid; });
|
||||
var mline = SDPUtil.parse_mline(this.localSDP.media[mid].split('\r\n')[0]);
|
||||
if (cands.length > 0) {
|
||||
var ice = SDPUtil.iceparams(this.localSDP.media[mid], this.localSDP.session);
|
||||
ice.xmlns = 'urn:xmpp:jingle:transports:ice-udp:1';
|
||||
cand.c('content', {creator: this.initiator == this.me ? 'initiator' : 'responder',
|
||||
name: cands[0].sdpMid
|
||||
name: (cands[0].sdpMid? cands[0].sdpMid : mline.media)
|
||||
}).c('transport', ice);
|
||||
for (var i = 0; i < cands.length; i++) {
|
||||
cand.c('candidate', SDPUtil.candidateToJingle(cands[i].candidate)).up();
|
||||
|
|
Loading…
Reference in New Issue