Skip to content

Commit

Permalink
refactor: parameters.js just check and warn not throw
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur committed Oct 9, 2018
1 parent e446260 commit 3b674eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dev/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ var peer = this;

if (typeof arguments[0].getStats !== 'function') {
throw '1st argument is not exit getStats function';
}

if (arguments[0] instanceof RTCPeerConnection) {
peer = arguments[0];

if (!!navigator.mozGetUserMedia) {
mediaStreamTrack = arguments[1];
callback = arguments[2];
interval = arguments[3];
}
}

if (arguments[0] instanceof RTCPeerConnection) {
if (!!navigator.mozGetUserMedia && !(mediaStreamTrack instanceof MediaStreamTrack)) {
console.warn('2nd argument is not instance of MediaStreamTrack.');
}
Expand Down

0 comments on commit 3b674eb

Please sign in to comment.