Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Now RecordRTC will skip MediaRecorder for Chrome < 49
- Loading branch information
Showing
9 changed files
with
106 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
function isMediaRecorderCompatible() { | ||
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; | ||
var isChrome = !!window.chrome && !isOpera; | ||
var isFirefox = typeof window.InstallTrigger !== 'undefined'; | ||
|
||
if (isFirefox) { | ||
return true; | ||
} | ||
|
||
if (!isChrome) { | ||
return false; | ||
} | ||
|
||
var nVer = navigator.appVersion; | ||
var nAgt = navigator.userAgent; | ||
var fullVersion = '' + parseFloat(navigator.appVersion); | ||
var majorVersion = parseInt(navigator.appVersion, 10); | ||
var nameOffset, verOffset, ix; | ||
|
||
if (isChrome) { | ||
verOffset = nAgt.indexOf('Chrome'); | ||
fullVersion = nAgt.substring(verOffset + 7); | ||
} | ||
|
||
// trim the fullVersion string at semicolon/space if present | ||
if ((ix = fullVersion.indexOf(';')) !== -1) { | ||
fullVersion = fullVersion.substring(0, ix); | ||
} | ||
|
||
if ((ix = fullVersion.indexOf(' ')) !== -1) { | ||
fullVersion = fullVersion.substring(0, ix); | ||
} | ||
|
||
majorVersion = parseInt('' + fullVersion, 10); | ||
|
||
if (isNaN(majorVersion)) { | ||
fullVersion = '' + parseFloat(navigator.appVersion); | ||
majorVersion = parseInt(navigator.appVersion, 10); | ||
} | ||
|
||
return majorVersion >= 49; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters