Skip to content

Commit

Permalink
fix: mediastream
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur committed Nov 26, 2018
1 parent 4baacc9 commit d606294
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dev/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ if (typeof arguments[0].getStats === 'function') {
} else {
throw '1st argument is not exit getStats function';
}

// MediaStreamTrack 或 RTCPeerConnection 不存在时,Android/IOS环境中,不作检测
if (arguments[0] instanceof RTCPeerConnection) {
if (!!navigator.mozGetUserMedia && !(mediaStreamTrack instanceof MediaStreamTrack)) {
console.warn('2nd argument is not instance of MediaStreamTrack.');
}
} else if (!!navigator.mozGetUserMedia && !(mediaStreamTrack instanceof MediaStreamTrack)) {
} else if (MediaStreamTrack && !!navigator.mozGetUserMedia && !(mediaStreamTrack instanceof MediaStreamTrack)) {
console.warn('1st argument is not instance of MediaStreamTrack.');
}
6 changes: 3 additions & 3 deletions getStats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Last time updated: 2018-11-19 8:04:44 AM UTC
// Last time updated: 2018-11-26 3:26:22 AM UTC

// _______________
// getStats v1.0.10
Expand Down Expand Up @@ -181,12 +181,12 @@ window.getStats = function(mediaStreamTrack, callback, interval) {
} else {
throw '1st argument is not exit getStats function';
}

// MediaStreamTrack 或 RTCPeerConnection 不存在时,Android/IOS环境中,不作检测
if (arguments[0] instanceof RTCPeerConnection) {
if (!!navigator.mozGetUserMedia && !(mediaStreamTrack instanceof MediaStreamTrack)) {
console.warn('2nd argument is not instance of MediaStreamTrack.');
}
} else if (!!navigator.mozGetUserMedia && !(mediaStreamTrack instanceof MediaStreamTrack)) {
} else if (MediaStreamTrack && !!navigator.mozGetUserMedia && !(mediaStreamTrack instanceof MediaStreamTrack)) {
console.warn('1st argument is not instance of MediaStreamTrack.');
}

Expand Down
Loading

0 comments on commit d606294

Please sign in to comment.