Skip to content

Commit

Permalink
Fix. "TypeError: 'arguments', 'callee', and 'caller' cannot be access…
Browse files Browse the repository at this point in the history
…ed in this context, when using addTrack() method" (#1024)

PR to fix the issue "TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context, when using addTrack() method"
Fixes #1023
  • Loading branch information
dimitrisniras committed Feb 28, 2020
1 parent 75c6b6c commit beed221
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/js/safari/safari_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ export function shimLocalStreamsAPI(window) {
};

window.RTCPeerConnection.prototype.addTrack =
function addTrack(track) {
const stream = arguments[1];
if (stream) {
if (!this._localStreams) {
this._localStreams = [stream];
} else if (!this._localStreams.includes(stream)) {
this._localStreams.push(stream);
}
function addTrack(track, ...streams) {
if (streams) {
streams.forEach((stream) => {
if (!this._localStreams) {
this._localStreams = [stream];
} else if (!this._localStreams.includes(stream)) {
this._localStreams.push(stream);
}
});
}
return _addTrack.apply(this, arguments);
};
Expand Down

0 comments on commit beed221

Please sign in to comment.