Skip to content

Commit

Permalink
Add adapter artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo committed Jul 31, 2018
1 parent 12c96c6 commit da34523
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 22 deletions.
23 changes: 17 additions & 6 deletions release/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3773,6 +3773,9 @@ module.exports = function(window) {
};

var shimError_ = function(e) {
if (browserDetails.version >= 64) {
return e;
}
return {
name: {
PermissionDeniedError: 'NotAllowedError',
Expand Down Expand Up @@ -4390,7 +4393,9 @@ module.exports = {
this.dispatchEvent(event);
}.bind(this));
}.bind(this));
}
},
enumerable: true,
configurable: true
});
}
if (typeof window === 'object' && window.RTCTrackEvent &&
Expand Down Expand Up @@ -4979,12 +4984,17 @@ module.exports = {
return this._onaddstream;
},
set: function(f) {
var pc = this;
if (this._onaddstream) {
this.removeEventListener('addstream', this._onaddstream);
this.removeEventListener('track', this._onaddstreampoly);
}
this.addEventListener('addstream', this._onaddstream = f);
}
});
var origSetRemoteDescription =
window.RTCPeerConnection.prototype.setRemoteDescription;
window.RTCPeerConnection.prototype.setRemoteDescription = function() {
var pc = this;
if (!this._onaddstreampoly) {
this.addEventListener('track', this._onaddstreampoly = function(e) {
e.streams.forEach(function(stream) {
if (!pc._remoteStreams) {
Expand All @@ -5000,7 +5010,8 @@ module.exports = {
});
});
}
});
return origSetRemoteDescription.apply(pc, arguments);
};
}
},
shimCallbacksAPI: function(window) {
Expand Down Expand Up @@ -5160,7 +5171,7 @@ module.exports = {
}


if (typeof offerOptions.offerToReceiveAudio !== 'undefined') {
if (typeof offerOptions.offerToReceiveVideo !== 'undefined') {
// support bit values
offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo;
}
Expand Down Expand Up @@ -5367,4 +5378,4 @@ module.exports = {
};

},{}]},{},[3])(3)
});
});
23 changes: 17 additions & 6 deletions release/adapter_no_edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,9 @@ module.exports = function(window) {
};

var shimError_ = function(e) {
if (browserDetails.version >= 64) {
return e;
}
return {
name: {
PermissionDeniedError: 'NotAllowedError',
Expand Down Expand Up @@ -2376,7 +2379,9 @@ module.exports = {
this.dispatchEvent(event);
}.bind(this));
}.bind(this));
}
},
enumerable: true,
configurable: true
});
}
if (typeof window === 'object' && window.RTCTrackEvent &&
Expand Down Expand Up @@ -2965,12 +2970,17 @@ module.exports = {
return this._onaddstream;
},
set: function(f) {
var pc = this;
if (this._onaddstream) {
this.removeEventListener('addstream', this._onaddstream);
this.removeEventListener('track', this._onaddstreampoly);
}
this.addEventListener('addstream', this._onaddstream = f);
}
});
var origSetRemoteDescription =
window.RTCPeerConnection.prototype.setRemoteDescription;
window.RTCPeerConnection.prototype.setRemoteDescription = function() {
var pc = this;
if (!this._onaddstreampoly) {
this.addEventListener('track', this._onaddstreampoly = function(e) {
e.streams.forEach(function(stream) {
if (!pc._remoteStreams) {
Expand All @@ -2986,7 +2996,8 @@ module.exports = {
});
});
}
});
return origSetRemoteDescription.apply(pc, arguments);
};
}
},
shimCallbacksAPI: function(window) {
Expand Down Expand Up @@ -3146,7 +3157,7 @@ module.exports = {
}


if (typeof offerOptions.offerToReceiveAudio !== 'undefined') {
if (typeof offerOptions.offerToReceiveVideo !== 'undefined') {
// support bit values
offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo;
}
Expand Down Expand Up @@ -3353,4 +3364,4 @@ module.exports = {
};

},{}]},{},[3])(3)
});
});
21 changes: 16 additions & 5 deletions release/adapter_no_edge_no_global.js
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,9 @@ module.exports = function(window) {
};

var shimError_ = function(e) {
if (browserDetails.version >= 64) {
return e;
}
return {
name: {
PermissionDeniedError: 'NotAllowedError',
Expand Down Expand Up @@ -2376,7 +2379,9 @@ module.exports = {
this.dispatchEvent(event);
}.bind(this));
}.bind(this));
}
},
enumerable: true,
configurable: true
});
}
if (typeof window === 'object' && window.RTCTrackEvent &&
Expand Down Expand Up @@ -2965,12 +2970,17 @@ module.exports = {
return this._onaddstream;
},
set: function(f) {
var pc = this;
if (this._onaddstream) {
this.removeEventListener('addstream', this._onaddstream);
this.removeEventListener('track', this._onaddstreampoly);
}
this.addEventListener('addstream', this._onaddstream = f);
}
});
var origSetRemoteDescription =
window.RTCPeerConnection.prototype.setRemoteDescription;
window.RTCPeerConnection.prototype.setRemoteDescription = function() {
var pc = this;
if (!this._onaddstreampoly) {
this.addEventListener('track', this._onaddstreampoly = function(e) {
e.streams.forEach(function(stream) {
if (!pc._remoteStreams) {
Expand All @@ -2986,7 +2996,8 @@ module.exports = {
});
});
}
});
return origSetRemoteDescription.apply(pc, arguments);
};
}
},
shimCallbacksAPI: function(window) {
Expand Down Expand Up @@ -3146,7 +3157,7 @@ module.exports = {
}


if (typeof offerOptions.offerToReceiveAudio !== 'undefined') {
if (typeof offerOptions.offerToReceiveVideo !== 'undefined') {
// support bit values
offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo;
}
Expand Down
21 changes: 16 additions & 5 deletions release/adapter_no_global.js
Original file line number Diff line number Diff line change
Expand Up @@ -3773,6 +3773,9 @@ module.exports = function(window) {
};

var shimError_ = function(e) {
if (browserDetails.version >= 64) {
return e;
}
return {
name: {
PermissionDeniedError: 'NotAllowedError',
Expand Down Expand Up @@ -4390,7 +4393,9 @@ module.exports = {
this.dispatchEvent(event);
}.bind(this));
}.bind(this));
}
},
enumerable: true,
configurable: true
});
}
if (typeof window === 'object' && window.RTCTrackEvent &&
Expand Down Expand Up @@ -4979,12 +4984,17 @@ module.exports = {
return this._onaddstream;
},
set: function(f) {
var pc = this;
if (this._onaddstream) {
this.removeEventListener('addstream', this._onaddstream);
this.removeEventListener('track', this._onaddstreampoly);
}
this.addEventListener('addstream', this._onaddstream = f);
}
});
var origSetRemoteDescription =
window.RTCPeerConnection.prototype.setRemoteDescription;
window.RTCPeerConnection.prototype.setRemoteDescription = function() {
var pc = this;
if (!this._onaddstreampoly) {
this.addEventListener('track', this._onaddstreampoly = function(e) {
e.streams.forEach(function(stream) {
if (!pc._remoteStreams) {
Expand All @@ -5000,7 +5010,8 @@ module.exports = {
});
});
}
});
return origSetRemoteDescription.apply(pc, arguments);
};
}
},
shimCallbacksAPI: function(window) {
Expand Down Expand Up @@ -5160,7 +5171,7 @@ module.exports = {
}


if (typeof offerOptions.offerToReceiveAudio !== 'undefined') {
if (typeof offerOptions.offerToReceiveVideo !== 'undefined') {
// support bit values
offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo;
}
Expand Down

0 comments on commit da34523

Please sign in to comment.